using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerFightState : PlayerBaseState
{
public override void EnterState(Player player)
{
player.anim.SetBool(“IsFight”,true);
}
public override void update(Player player)
{
if (!player.anim.GetCurrentAnimatorStateInfo(0).IsName("Fight"))//getting curr
{
player.anim.SetBool("IsFight", false);
player.SwitchState(player.idleState);
}
}
public override void OnCollisionEnter(Player player, Collision collision)
{
}
}
Its basically Finite State Machine implementation.
Actually i want to play the fight animation when key F is pressed(that is given when the state change from another state so key is not problem), when i press F animation is not playing.
idk why?