Moving fast may cause trigger problem!

Hi all!

Here is my problem, I have set triggers in my game, and
set OnTriggerExit() function to see if the monsters escaped the trigger, but then I found sometimes typically when Time.timeScale = 2.0f, monsters with a high moving speed may excape the trigger, but the OnTriggerExit didnt catch the event!

This issue causes many bugs in my game. If I set a second distance check to ensure the monster excapes, the performance dropped too much…

What should I do? Any Help?
I think this is the same BUG I saw before that rigidbodies may go through thin walls when both have a collider on them.

It’s not a bug, it’s expected behavior. You can increase the physics timestep so objects don’t move as far in one physics frame, but that of course has a performance cost.

–Eric

Thank you, Eric. Always such a quick reply!
I will have a try.

BTW, if there is about 20 triggers in a scene, is it true that increase the physics timestep may get 20 times of performance cost?

More triggers, colliders, etc, always have a potential overhead but the physics engine does a good job of managing it. Generally, the overhead of a physics object is minimal when it isn’t directly interacting with something else.