- Home /
moving sphere along the curved path
I have been following this code at:http://answers.unity3d.com/questions/12689/moving-an-object-along-a-bezier-curve.html
I have attached this script to a sphere. the code is working perfectly and the sphere is moving along the curved path but the problem is i am not able to increase or decrease the speed of the moving sphere.the code in the above link moves the sphere along the curve in the update method so i have created an instance of the sphere using instantiate method.now first time when the sphere is created it should move with slow speed and when the other instances are created the speed should increase gradually.how can i do this?
Answer by darthtelle · May 13, 2014 at 12:42 PM
Based on the equation in the question you linked to, the time is calculated on line 14. I would suggest multiplying the time by a speed factor to increase/decrease your speed.
float k_SpeedFactor = 5.0f;
BezierTime += Time.deltaTime * k_SpeedFactor;
@Sha$$anonymous$$i - darthtelle's suggestion should have fixed the problem. I suggest you post your code so we can take a look at what is going on.
Your answer
Follow this Question
Related Questions
aiming up and down 0 Answers
get bone path from transform 1 Answer
Need enemy to follow only active character 0 Answers