- Home /
OnCollisionEnter is called before the actual collision
I made a simple script that print's the name of the game object OnCollisionEnter for testing purposes. As you can see it prints out before the actual collision.
And this is when the actual collision happens.
I suppose the implied question here is "Why is this occurring?". Please post the code so that the community has a bit more to go off of then this general statement.
Thank you.
Answer by Eno-Khaon · Sep 16, 2015 at 01:55 AM
OnCollisionEnter() is triggered as part of the FixedUpdate cycles of the physics engine and is effectively disconnected from the rendering process.
When the collision occurs, it's almost guaranteed to take place between rendering frames. Therefore, the render would typically come a fraction of a frame after the collision takes place.
The first image was taken after stopping at that exact position. The collision never occurred.
Answer by Aily · Dec 18, 2018 at 11:57 AM
Disable PCM in physics settings, its little buggy. Generate contact info close to collision body, but in fact no collision.
Your answer
Follow this Question
Related Questions
Sword slashing logic on Gear VR using controller? 0 Answers
How to detect collision without OnCollisionEnter or OnTriggerEnter? 1 Answer
Why the "Detonator Explosion Framework" from AssetStore don't render in compiled game? 0 Answers
Smooth movement for the block upon player collision,Smooth box movement 0 Answers