- Home /
Mesh Collider colliding with Primitives is jittery
When the two collide the collision doesn't feel smooth (even when I add physics materials). If I use both mesh colliders or both primitives against each other it collides smoothly.
The other object is a cylinder shape and I want to use a mesh collider for that to get accurate collisions.
Any ideas on how to remove the jitter?
Answer by spidermancy612 · Jul 27, 2017 at 04:34 PM
Typically the way physics works in games is that when you move an object and hit another, the object actually enters the physical space of the second, so what the engine does is recognize that this isn't suppose to happen and move the first object out of the second.
There's a few ways to get around the jittery look but they all depend on what you're trying to do. So for example if you're having an elevator type interaction then you need to actually move both objects, not just the one.
The $$anonymous$$esh collider object is an unmoving object. The one with the primitives pushes the object. While I am pushing the object it jitters and it does not look good at all.
Got any ideas?
$$anonymous$$y solution to a similar problem was to attach a box collider set to isTrigger along the surface pushing another object. The trigger should be a child object to the one pushing and have a script that holds object references for anything in the trigger. From there I have the script moving the parent object to also look for any objects being tracked by the child and move those objects at the same time.
From a code standpoint it's just asking if anything is in the trigger, and if so then move it at the same rate as the parent object is being moved. It prevents jitter and looks identical to the player.
Your answer
Follow this Question
Related Questions
RigidBody controller - Where to start? 0 Answers
Collisions occassionaly fail. 4 Answers
Physics optimization 3 Answers
Apply rigid body force in opposite direction of collider 1 Answer
Elastic Collisions with Rigidbodies 1 Answer