- Home /
Problem with MeshColliders and Rigidbodies
I'm making a physics orientated game and I have run into a very annoying problem which I will try to explain the best I can. Due to a NDA I cannot comment on the type of game, so please bare with me.
I have my main physics object which is:
A MeshCollider set to Convex with a simplified mesh
A Rigidbody left at the default values
I have an object in my world which has scripted movement, it has:
A MeshCollider set to Convex with a simplified mesh
A Rigidbody set to kismetic and no gravity.
The problem is when the main physics object comes in contact with the scripted object, it goes right through it and/or will be launched.
When I remove the Rigidbody of the scripted object, the main object reacts properly, but when the main object goes to sleep, it won't be waked when the scripted object goes through it (hence I attached a rigidbody). When I replace the MeshCollider of the scripted object with a BoxCollider and leave the Rigidbody set to Kismetic, everything works as I expect it to, except for the collision being square (obviously).
Did I miss a setting somewhere? Why doesn't it work as I set it up initially, but it does when I replace the MeshCollider? It took me ages to find the proper scales and physics settings which feel right for the game I'm making and it's only this particular case that goes wrong.
EDIT: The simplified meshes of both objects is far below the maximum of 255 tris.
Answer by LennardF1989 · Apr 12, 2012 at 01:32 PM
Fixed it myself, apparantly it was caused by how I was moving my object.
I updated the code to use rigidbody.MovePosition(_currentPosition);
inside public void FixedUpdate()
and now it all works flawless!
Your answer
Follow this Question
Related Questions
Adding real life physics behavior on 3-d object. 1 Answer
Moving Trigger not detecting stationary MeshCollider 0 Answers
Box Collider z Axis unwanted reset 5 Answers
Rigidbody slowly falling through mesh collider 0 Answers
Why do I get OnTriggerExit upon collision when a rigidbody is kinematic? (example) 3 Answers