Trigger Script not working
So I have an object that has to go through a collider that has it's "is Trigger" turned on. and when it exits the collider the Trigger should turn off in order to enable the collision. But it's not working! When the object exits the collider the Trigger checkbox is still on! And my Tag is set correctly! Also, I have to use GetComponent because: collider.isTrigger = false; doesnt work.
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
}
void onTriggerExit (Collider other)
{
if (other.tag == "Player")
{
GetComponent<Collider>().isTrigger = false;
}
}
}
Comment
Best Answer
Answer by tanoshimi · Nov 11, 2016 at 08:04 AM
Case sensitivity matters. The method should be called OnTriggerExit, not onTriggerExit
Your answer
Follow this Question
Related Questions
Running shell scripts Mac: POST BUILD -1 Answers
Using mathf.sin 1 Answer
Problem with my Coroutine 1 Answer
Logical explaination of this code 1 Answer