- Home /
Question by
CupOfMayo · Jan 18, 2015 at 02:28 PM ·
javascripttransformellipse
Constant speed on elliptical path
So I'm using this script to move my object on elliptical path
var a : float;
var b : float;
var x : float; //offset x
var y : float; //offset y
var alpha : float;
function FixedUpdate()
{
alpha++;
X = x + (a*Mathf.Cos(alpha*Time.fixedDeltaTime));
Y = y + (b*Mathf.Sin(alpha*Time.fixedDeltaTime));
transform.position = Vector3(X,Y,0);
}
How do I modify this script so the object will always move with constant speed on the same path?
Comment