- Home /
Which Variables control the shape of a Beizer Curve?
Here is the link to the code that I am using:
http://answers.unity3d.com/questions/5279/moving-an-object-along-a-bezier-curve
Hi,
I found this great solution with moving objects along a curve. It works fine, but I don't know which variable controls the speed of the object. Currently, the object moves from control point 1 to control point 2. But the movement happens very fast.
Which variable controls the speed?
Also, which variables control the tightness of the curve? The object is currently on a very loose loop, I am not sure which variables control the path of the curve. Thanks in advance. Please me know if this in unclear.
Here is the link to the code:
http://answers.unity3d.com/questions/5279/moving-an-object-along-a-bezier-curve
Answer by Peter G · Mar 06, 2011 at 06:42 PM
I haven't tested this script, but it would appear that the following is true:
Just looking at the code, there is nothing that controls the speed. You can add it very simply though:
//Change this line:
//BezierTime = BezierTime + Time.deltaTime;
//to
BezierTime = BezierTime + Time.deltaTime / TimeInSecondsForEntireCurve;
And, currently there does not appear to be a variable controlling the tightness of the curve. I suggest you find the equation of a bezier curve so that you can figure out what variable you need and add it yourself :).