- Home /
How does Unity detect collision?
I am trying to move a cylinder(cylinder 1) to hit another cylinder(cylinder 2) using AddForce and recording the position of the cylinder 1 using OnCollisionEnter when it collides to the cylinder 2.
The direction of the both cylinders is Y-axis which is also the gravitational direction. Their Y position and X Y Z rotation has been frozen so that they can only move along the xz plain. Also, there is no friction & no bounciness between the two cylinders.
And if I move the cylinder 1 along the x-axis to hit the cylinder 2, the position of the cylinder 1, when it hits the cylinder 2, should be the same regardless of the initial x position of the cylinder 1 if the initial z position is the same, but it's not.
In the both pictures, Cylinder 1 to AddForce(2,0,0,ForceMode.Impulse) initial position of cylinder 1: left) (-0.2,0,0), right) (-0.05,0,0) position of cylinder 1 when collision: left) (0.0089, 0, -0.0040), right) (0.0177, 0, -0.0064)
Why does this happen? Is there any intrinsic randomness?
Your answer
Follow this Question
Related Questions
How to detect which side of my player has collided? 2 Answers
Best way to detect precise location of a collision on mesh collider? 0 Answers
collisions will sometimes be detected and sometimes will not 1 Answer
Probably another "bullet through paper problem". Jerks, teleports, and other problems 0 Answers