Skip to content
Snippets Groups Projects
Bandit.cs 623 B
Newer Older
  • Learn to ignore specific revisions
  • public class Bandit : Enemy
    
    {
    
        [SerializeField, Tooltip("When the AntiPlayer is closer than this value, change to a combat idle anim")]
        float playerNearDistance = 3.75f;
    
        protected override void Awake()
        {
            base.Awake();
    
            animator.SetBool("Grounded", true);
    
        }
    
        protected override void Update()
        {
            base.Update();
            if (GetDistanceToAntiPlayer() < playerNearDistance)
            {
                animator.SetInteger("AnimState", 1); // Combat Idle
            }
            else
            {
                animator.SetInteger("AnimState", 0); // Idle
            }
        }
    
    }