- Home /
Configurable Joint referencing from scrip
Basically I am trying to create an arm, with an elbow that I would be able to control with input. I found this thread. It seems to deal with the exact problem, but does not mention how to reference the joint. (specifically the "thisConfJoint" variable) I have tried to find answer even further than on Google page 10, but with no luck. Should I do something like GameObject Joint = thisConfJoint
. Nothing I try seems to work. Please at least direct me in the right direction guys. :/
Answer by Peter G · Jan 01, 2012 at 06:20 PM
You should do something like:
public ConfigurableJoint myJoint;
void Start () {
myJoint = GetComponent<ConfigurableJoint>();
}
or you can make a variable and drag it to it in the inspector.
Thanks, Peter! I did the second solution (created a public variable and dragged it in) and it works now! Thanks :)
Your answer
Follow this Question
Related Questions
Using a ConfigurableJoint to move an object to a postion and rotation. 0 Answers
Sloppy HingeJoints 0 Answers
How do I set up a ConfigurableJoint so that it behaves just like a HingeJoint? 1 Answer
How to use multiple spring joints on the same object? 1 Answer
Spring Joint and Tethered Ball 0 Answers