A script that I copied from a tutorial only works when it is being run inside the editor. When I export it nothing happens. (the script is for moving platforms)
Here is the script:
var targetA : GameObject; var targetB : GameObject;
var speed : float = 0.1;
function Update () { var weight = Mathf.Cos(Time.time * speed * 2 * Mathf.PI) * 0.5 + 0.5; transform.position = targetA.transform.position * weight + targetB.transform.position * (1-weight); }
What is going wrong?