- Home /
Adding Torque to a Hinge Joint
I am trying to add torque to a hinge joint I have set up between two rigid bodies. Both are set to ignore gravity and to be kinematic. I see no response between the objects when I try to test it. The script appears to function (I do have a button assigned to Fire1 and it is working) but I see no actual motion or movement from the hinge joint.
What am I doing wrong here?
My script reads as follows:
#pragma strict
function Start () {
}
function Update () {
if(Input.GetButtonDown("Fire1")){
rigidbody.AddTorque(Vector3.up * 100);
}
}
Thank you for any help you can provide.
Answer by AdenFlorian · Aug 18, 2013 at 09:45 AM
The rigid bodies must have isKinematic unchecked to be able to apply any kind of force to it, or for it to respond to any force.
http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-isKinematic.html
I have exactly the same problem but my objects have not convex meshes. I need them to not be convex since these objects have holes, which I need. Unfortunately, Unity doesn't support not convex meshes which are not kinematic. I need hinges too. How can I do?
Your answer
Follow this Question
Related Questions
Multi-Touch help 1 Answer
Transfer controls from keyboard buttons to IPhone buttons 1 Answer
How do you change a variable in a script, that is on an object instantiated from a prefab? 0 Answers
I know javascript but i don't understand Unity's javascript! 1 Answer
musket gun script is not working 3 Answers