using UnityEngine; public class AnimController : MonoBehaviour { Animator anim; // static public float speed = 10.0f; public float rotationSpeed = 100.0f; void Start() { anim = GetComponent(); } void Update() { float translation = Input.GetAxis("Vertical") * speed; float rotation = Input.GetAxis("Horizontal") * rotationSpeed; translation *= Time.deltaTime; rotation *= Time.deltaTime; transform.Translate(0f, 0f, translation); // mountains need separate colliders transform.Rotate(0f, rotation, 0f); if (Input.GetKeyDown(KeyCode.Space)) { anim.SetTrigger("isJump"); } if (translation != 0f) { anim.SetBool("isWalk", true); } else { anim.SetBool("isWalk", false); } } }