can someone please tell me why my animations are mixing and how I can stop it. The character slot for another animation stays on when I switch animations(via code), if the animation is in a moving state and I choose another via key press, it stops in position and plays the new animation in that position.
Here is my code and a video of what happens
using UnityEngine;
using Spine.Unity;
using Spine;
using System.Collections;
public class Animator_Call : MonoBehaviour
{
[SpineAnimation]
public string CharAnimationAngry;
SkeletonAnimation skeletonAnimation;
// Use this for initialization
void Start ( )
{
skeletonAnimation = GetComponent<SkeletonAnimation>( );
skeletonAnimation.loop = true;
}
// Update is called once per frame
void Update ( )
{
if( Input.GetKeyDown(KeyCode.R) )
{
skeletonAnimation.AnimationName = "Idle_Normal_1";
}
else
if( Input.GetKeyDown(KeyCode.Alpha1) )
{
skeletonAnimation.AnimationName = "Angry";
}
else
if( Input.GetKeyDown(KeyCode.Alpha2) )
{
skeletonAnimation.AnimationName = "Bashful";
}
else
if( Input.GetKeyDown(KeyCode.Alpha3) )
{
skeletonAnimation.AnimationName = "Blushing";
}
else
if( Input.GetKeyDown(KeyCode.Alpha4) )
{
skeletonAnimation.AnimationName = "Confused";
}
else
if( Input.GetKeyDown(KeyCode.Q) )
{
skeletonAnimation.AnimationName = "Cry_Face";
}
else
if( Input.GetKeyDown(KeyCode.Alpha5) )
{
skeletonAnimation.AnimationName = "Happy";
}
else
if( Input.GetKeyDown(KeyCode.Alpha6) )
{
skeletonAnimation.AnimationName = "Idle_Angry";
}
else
if( Input.GetKeyDown(KeyCode.Alpha7) )
{
skeletonAnimation.AnimationName = "Idle_Blush";
}
}
}