Collision being slow to react

So i have had my game in play mode for a few minuets now and have had to rocket sitting on this un tagged object. some times the collision is detected as soon as i hit it and sometimes its only detected when i either move off the object or hit something else.

1 Like

OnCollisionEnter only detects collisions when first colliding with an object, if the rocket stays on top of the object it won’t detect anything again until moved. If you want the rocket to detect the collisions constantly you’ll need to use OnCollisionStay, keep in mind that Rick’s code won’t work correctly with that method, only use it if you are confident enough in what you are doing.

Hope this helps!

Thanks for that suggestion. the issues mainly is sometimes when i hit the object it wont register e.g if i land on the side or dead flat on the bottom it wont register. It seems to only detect if an edge hits and not a face

Unity’s physics simulation is highly optimised, so imprecise behaviour is expected. What you could do is to set the Collision Detection of the player’s Rigidbody component to “Continuous”. You could also increase a few values in the Physics settings to see if that improves the result. However, since the performance is more important than precision, find a good balance between both and don’t try to copy the real world.

Thanks for that link, I may just have to play around a bit. also 99% of the time the user hits one of the corners anyway so it works decently well

So a friend helped me work the issue, I was using OnCollisionExit not OnCollisionEnter

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms