void Awake() { RoomIndex = SceneManager.GetActiveScene().buildIndex; PV = GetComponent <PhotonView>(); controller = GetComponent <PlayerControllerTest>(); rb = GetComponent <Rigidbody>(); }
void OnTriggerEnter(Collider collider) { if (collider.gameObject.tag == "Player") { Player = collider.gameObject.GetComponent <PlayerControllerTest>(); if (CanBePickUp && Player != null) { Debug.Log("I'm not null"); PickUpObject(); print("Item Picked Up"); } //Destroy(gameObject); } }
private void Awake() { Player = GetComponent <PlayerControllerTest>(); //destroy the controller if the player is not controlled by me if (!photonView.IsMine) { if (GetComponent <InputReceive>() != null) { Destroy(GetComponent <InputReceive>()); } Destroy(GetComponentInChildren <Camera>().gameObject); Destroy(GetComponentInChildren <Rigidbody>()); Destroy(orientation.gameObject); } }
private void Awake() { PhotonNetwork.SendRate = 25; PhotonNetwork.SerializationRate = 15; Player = GetComponent <PlayerControllerTest>(); //destroy the controller if the player is not controlled by me if (!photonView.IsMine) { if (GetComponent <InputReceive>() != null) { Destroy(GetComponent <InputReceive>()); } Destroy(GetComponentInChildren <Camera>().gameObject); _rb = GetComponentInChildren <Rigidbody>(); _rb.useGravity = false; Destroy(orientation.gameObject); Destroy(SpeedLine); Destroy(SprintEffect); } }
private void Awake() { rb = GetComponent <Rigidbody>(); player = GetComponent <PlayerControllerTest>(); Controller = GetComponent <InputReceive>(); }
// Use this for initialization void Start() { Player = GetComponent <PlayerControllerTest>(); }