- Home /
Method for grabbing rigidbody
I am making a game where the player can pick up and place objects. When the player is placing the objects I use a hingjoint and connect it to a "hand" object that moves to a raycast point (this 'hand' is a Kinematic rigidbody). This works well but when the object being placed contacts and pushes other rigidbodys it pushes them with an unlimited force.
Is there a way I can use this method (or another method) and make it so the object being carried is only held in place with a limited force?
Thank you for the quick response!
Yes all the physics parameters are set correctly prior to picking up the object. The problem is when the physics object is put on a hinge and attached to a $$anonymous$$inematic rigidbody the hinge has infinite force to push other bodies.
Is there a way I can make the object move to a point in space using only a specific maximum force?
Answer by grimmdev · Sep 02, 2012 at 08:26 AM
I think a quick method if the other object has rigid body is to manipulate it's velocity on collision like so.
rigidbody.velocity = Vector3.zero;
Good example here http://forum.unity3d.com/threads/24541-resetting-a-gameobject-after-a-collision
Answer by CharlesD · Sep 02, 2012 at 07:21 AM
Well a secondary method would be to write a script and have it clamp the maximum force applied to something reasonable, but a more practical solution maybe to place a break force on your hinge joint. If the object you are carrying resists motion too much the joint will break and the object will fall free. It may also be possible to set the object you pick up to have almost zero mass (absolute zero won't work) so it cannot interact with other physics objects in any meaningful way.
Your answer
Follow this Question
Related Questions
Distance From & CrossHair 0 Answers
Holding object not working. Raycast, and first person. 1 Answer
How to grab objects in 3rd person LITTLE BIG PLANET STYLE 2 Answers
How push the object? 2 Answers