// Update is called once per frame void Update() { if (Input.GetKey(KeyCode.RightArrow)) { Sprite.Play("Run"); Vector3 pos = transform.position; pos.x += Time.deltaTime * 2; transform.position = pos; } else { sprite.Stop(); } }
// Update is called once per frame void Update() { if (Input.GetKey(KeyCode.RightArrow)) { sprite.Play("Run"); // heh, remember C# is case sensitive :) Vector3 pos = transform.position; pos.x += Time.deltaTime * 2; transform.position = pos; } else { sprite.Stop(); } }