public override void OnStartClient() { curPos = 0.5f; transform.position = left + ((right - left) * curPos); //find the coordinator and register ourselves (this should happen on server & clients) this.ChatWindow = GameObject.FindGameObjectWithTag("ChatWindow").GetComponent<ChatWindowController>(); this.PongCoordinator = GameObject.FindGameObjectWithTag("GameController").GetComponent<MPPongCoordinator>(); //this code is first executed server-side, and causes the new game to start even before there is a localplayer object //this.PongCoordinator.RegisterPlayer(this); }
public override void OnStartClient() { ball = GetComponent<Rigidbody>(); ball.velocity = new Vector3(speed, 0f, speed); pongCoordinator = GameObject.FindGameObjectWithTag("GameController").GetComponent<MPPongCoordinator>(); }