Hello
I’m wondering if OnTriggerEnter / OnTriggerExit buged or what on version 4.2.2?
I have created an empty GameObject, attached a sphere collider, IsTrigger = true, attached rigidbody, use gravity = false and iskinematic = true
attached a script that have only OnTriggerEnter debuging “Entered” and OnTriggerExit debuging “Exited”
only trigger if my character transform enter/exit the collider limits
I was caching my character transform to a static variable
OnTriggerEnter runs normally, but OnTriggerExit sometime get triggered and sometimes not
Even worse that sometimes while staying within the collider limits I get a message that I have exited followed by entered instantly
Other times I enter and “Entered” is debuged, I exit but I don’t get “Exited” , I wait a while outside collider limits then suddenly I see exited, doesn’t happen most of the time, mostly I never get exited
I got suspicious that it is something in my scripts so I decided to create a new game object with collider and rigid body as above and gave it a new tag that I created only to test this and parented it to my character and used the following code
void OnTriggerEnter(Collider other)
{
if (other.tag == "SpawnActivatorTrigger")
{
Debug.Log("Entered");
}
}
void OnTriggerExit(Collider other)
{
if (other.tag == "SpawnActivatorTrigger")
{
Debug.Log("Exited");
}
}
But same broblems, OnTriggerExit works a few times but doesn’t work most of the time and still it get fired sometimes even if I still within the collider boundary
Anyone else having this issue ?