// Use this for initialization void Start() { Player1 = GameObject.FindObjectOfType <PlayerOneScript>(); Player2 = GameObject.FindObjectOfType <PlayerTwoScript>(); paddleToBallVector1 = this.transform.position - Player1.transform.position; paddleToBallVector2 = this.transform.position - Player2.transform.position; player1SCORE = 0; Player1Score.text = player1SCORE.ToString(); player2SCORE = 0; Player2Score.text = player2SCORE.ToString(); spawn = transform.position; }
void Start() { countDownTime = 3; lastPlayer = null; rb = GetComponent<Rigidbody2D> (); p2s = player2.GetComponent<PlayerTwoScript> (); p1s = player1.GetComponent<PlayerOneScript> (); if (startCooldown) { countDown.BroadcastMessage ("SetBall", gameObject); countDown.BroadcastMessage ("StartCountDown"); } else { PushBall(); startCooldown = true; } }