Hi guys, i have question…
what’s wrong with OnTriggerExit in unity v3.5.6? In v3.4.2 this function works, but i can’t get it to work in current version.
Post an example.
you can take as example any script you can imagine.
Even script from documentation:
Works fine for me. Have you looked at other options (ie) Do you have a collider set to trigger?
I am not beginner.
You use latest version of unity? And character controller for test?
If you are using a character controller, you cannot use a rigidbody which is required to call any OnTrigger functions.
Then explain me please why OnTriggerEnter works fine, but OnTriggerExit don’t?
And you want to say that i can’t simply attach rigidbody component to GO with character controller (and untick use gravity option)?
Well that’s weird, I was never able to attach a rigidbody to a character controller before. I should try that out when I get home. But from what I read on the documentation on Unity’s Character Controller, you can’t have a rigidbody on it (you can have it on the other collider though, as long as both has at least one rigidbody among them).
Anyway, if you claim OnTriggerEnter works, OnTriggerExit should be working as well. If you must absolutely use OnTriggerExit, might I suggest a replacement and use OnCollisionExit instead? It’s roughly the same as OnTriggerExit but carries more information about the collision I believe?
Yes, there is other ways (in my case i can’t use OnCollisionExit), but i want to understand what’s wrong with OnTriggerExit. I am doing something wrong, or it is unity bug.
Perhaps a small hitch in your code?