// Use this for initialization void Start() { camFollowScript = Camera.main.GetComponent <CameraFollowBullet>(); goGui = GameObject.Find("GuiInput"); leftVal = goGui.transform.position.x; orgScreenRect = new Rect(leftVal + 300.0f, Screen.height - 40.0f, 120.0f, 30.0f); angSpdObj = goGui.GetComponent <AngleSpeedGUI>(); }
public void SwitchPlayer() { CameraFollowBullet camFollowScript = Camera.main.GetComponent <CameraFollowBullet>(); nextPlayer(); switchCamera(camFollowScript); //Check if the below line is an overhead...... camFollowScript.enabled = true; }
void switchCamera(CameraFollowBullet camFollowScript) { // This was the problematic statement. A slight overhead here but I think we ll not call this like Update() cPlayer = GameObject.Find(NetworkManager.onlinePlayers[currentPlayer]).transform; camFollowScript.player = cPlayer; }