- Home /
Help resetting a spline for repeat use
Hey guys, I need some help.
I am working on creating a little robot arm, the idea is to get it to draw a circle. So far so good, I have a bot, I have the kinematics set up and everything seems to work. I can even get it to draw a circle... once!
then I am stuck. What I am doing is I have a spline and a trail render that get enabled on a button push. Then at the end of the function I disable to spline controller. What I would like to happen, is when I push the button again, it draws another circle. However I get nothing.
This is the code as it stands. function circle(){ //turn on kinamatics if(ikLimb.activeSelf == false){ kinTracker.transform.position = Vector3(trailChild.transform.position.x, trailChild.transform.position.y, trailChild.transform.position.z);
ikLimb.SetActive(true); }
//turn on path render
drawOn();
//put spline at tip of bot
forceSplineLocation.transform.position = Vector3(kinTracker.transform.position.x, kinTracker.transform.position.y, kinTracker.transform.position.z);
//turn on spline
kinTracker.GetComponent(SplineController).enabled = true;
//wait for path to draw
yield WaitForSeconds(4);
//turn off drawing and disable spline
drawOff();
kinTracker.GetComponent(SplineController).enabled = false;
}
any guidance would be greatly appreciated.