- Home /
Hinge Joint Script doesn't work..
First of all hi everybody and this is the question: I want to make a hinge joint between two rigidbodies and wrote this code. But unfortunately it did not work. My main goal is making this hinge joint while Collision Enter and pressing a keyboard key at the same time. But i can not do this without the hinge joint working first. Here is the code:
using UnityEngine;
using System.Collections;
public class attachcontrol : MonoBehaviour {
public Rigidbody myobj;
void AttachControl() {
hingeJoint.connectedBody = myobj;
hingeJoint.anchor = new Vector3(0.008575243f, -0.08854485f, -1.658814f);
} }
Answer by Mander · Aug 03, 2012 at 04:43 PM
function OnCollisionEnter (hit : Collision){
}
Your answer
Follow this Question
Related Questions
Configurable Joint in Script 1 Answer
Make a rope 0 Answers
Hinge Joints, distance to connected body 1 Answer
Disable weight "inheritance" when using HingeJoint2D? 1 Answer
Why are my hinge joints inaccurate? 1 Answer