I have a script which create object on start, then I want to move that object, but it doesn’t work
please tell me where is my mistake
var ball: Transform;
var speed : float = 15;
var z : float = -0.55;
var y = 94;
function Start() {
Instantiate(ball, Vector3 (0, y, z), Quaternion.identity);
}
function Update () {
var direction = ball.transform.right;
var x = (Input.GetAxis("Horizontal") * direction * Time.deltaTime * speed);
ball.transform.position = x;
}