Collision occurs but nothing happens?
Hey! So I have this very simple bit of code that will effectively "Turn off" both my player's actual controller script and the actual mouse look script one the player enters this collider. I have asked the OnTriggerEnter function to print me a handy little message when this occurs. I am getting the message that the trigger is working, however, the player is still active as ever. What could be causing this? Here's my code: void OnTriggerEnter(Collider other) { if (other.tag == "Player") { print("yes we have collided my friend");
character.GetComponent<CharController>().enabled = false;
mainCam.GetComponent<canMouseLook>().enabled = false;
}
}
Follow this Question
Related Questions
Collisions between two objects are not being detected. 1 Answer
Sphere is not using OnCollisionEnter/OnTriggerEnter/OnCollisionStay/OnTriggerStay functions 0 Answers
White line behind Object triggering collisions 0 Answers
OnTriggerEnter2D how to make an if statement for two tags which are the same 0 Answers