Hello. I’m making a little skiing game and I made 2 animations for grabs. a “mute” grab and a “safety” grab. The problem is, I can only get one of them to play depending on which one I place last in the code. It’s as if the second one overrides the first animation.
` private var turning : TurningScript; private var safety : AnimationState; private var mute : AnimationState; private var grab : GrabScript; function Start() { // find the current instance of the turning script: turning = FindObjectOfType(typeof(TurningScript)); // find the current instance of the grab script: grab = FindObjectOfType(typeof(GrabScript)); mute = animation["mute"]; safety = animation["safety"]; } function Update() { if(!turning.isGrounded) { if (grab.right) { safety.speed = 1; animation.CrossFade(safety.name); } else { safety.speed = -1.5; animation.CrossFade(safety.name); } safety.normalizedTime = Mathf.Clamp01(safety.normalizedTime); if (grab.topRight) { animation.CrossFade(mute.name); mute.speed = 1; } else { animation.CrossFade(mute.name); mute.speed = -1.5; } mute.normalizedTime = Mathf.Clamp01(mute.normalizedTime); } }`