- Home /
Incorrect contact normal direction for thin colliders?
Hi guys, first time posting here. Am having some issues with thin colliders.
My sword has a thin stick-like collider (0.03, 0.02, 1), and my goal is to not let two swords pass through each other.
I am using the PID controller from this answer: http://answers.unity.com/answers/1888946/view.html, so the swords are moved by force and torque.
However, pass through still happens. Upon closer inspection, I noticed that sometimes the contact normal is pointing towards the other collider, instead of away from it (see: https://youtu.be/n_x8HfqCyAU), so perhaps the physics engine pushes in that direction and causes the thin colliders to pass through each other?
I tried scaling up the swords by a factor of 10 and decreasing the DefaultContactOffset from 1e-05 to 1e-08, but these doesn't seem to help.
Am I doing something wrong? Or is this a Unity bug?
Any inputs are much appreciated!
Answer by LohQ · Feb 27 at 02:47 PM
When adding the "box collider" tag, I realized that I have never tried capsule collider before.
Turns out that capsule collider works so much better than box collider, so far no pass through has occurred in my testing.
Thank god I finally can proceed forward with my project :')
Your answer
Follow this Question
Related Questions
Collider bug? 0 Answers
My sword pushes enemies around? 1 Answer
AddForce to a point of a GameObject, not the center 1 Answer
Punching a crate 0 Answers
Imported 3D models collisions 1 Answer