- Home /
Move rigidbody with mouse with realistic physics interactions with other rigidbodies.
I am having problems with rigidbody.MovePosition
I am trying to use a mouse to move a rigidbody through a scene that has other rigidbodies. I want the mouse object to push other objects out of the with realistic momentum depending on the speed of the mouse movement and their mass differences. If the mouse is moving faster they should push them harder. If the mouse is moving slowly it should push them slowly.
I was trying to use rigidbody.MovePosition. The problem is that if I make the mouse rigidbody kinematic, it pushes heavy objects out of the way as if they have no mass. If I set isKinematic to false, then the mouse rigidbody pushes through the objects with variable results none of which look realistic at all. Sometimes it goes through the object, sometimes it barely pushes the object, sometimes the object goes flying away at high velocity. Is there an alternative to movePosition or another technique to get this kind of thing to work?
I have tried playing around with the physics interpolation for both the mouse object and the other rigidbodies but don't see any difference.