- Home /
Question by
The Roman One · Oct 24, 2012 at 12:42 AM ·
jointanchorconfigurable
Configurable Joint in Script
Hey guys.
How do I access a GameObject's configurable Join?! I looked around the forum for answers(couldn't find anything that helps me) but I did notice that it's different in script than any other joint. that's a piece of my code:
var CJ : ConfigurableJoint;
CJ.GetComponent(ConfigurableJoint);
function Update()
{
CJ.anchor=hit.point; //"hit.point" is a Vector3 type variable.
}
but it keeps showing me the following error: The variable CJ of 'Script' has not been assigned.
Comment
Answer by gitoffame · Jul 18, 2014 at 08:22 AM
Only 2 years late, but I just stumbled on this. I think what you may be looking for is:
var CJ : ConfigurableJoint;
CJ = this.GetComponent(ConfigurableJoint);
function Update()
{
CJ.targetPosition = hit.point; //"hit.point" is a Vector3 type variable.
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613082807im_/https://answers.unity.com/themes/thub/images/avi.jpg)