As I hopefully correctly understand the Animator "SetTrigger" will set the animation to false once it's done (correct me if I'm wrong), but this is not the case for my project.
I have two states. Default (do nothing) and Move. Default is automatically entered when the app is opened and Move is triggered when I call "SetTrigger". I expect that Animator will set this animation id to false once the animation is done and then go back to Default state. but this is not the case - animation keeps repeating. I can achieve this by calling "ResetTrigger" manually but then I need to detect when the animation is done, which is not convenient in my case.
I want to achieve that animation is played only once when called. Any ideas?
Thanks
EDIT: Adding animation controller
public class TestAnimation : MonoBehaviour
{
private Animator _animation;
private static readonly int Playing = Animator.StringToHash("PlayingTrigger");
// Start is called before the first frame update
void Start()
{
_animation = GetComponent<Animator>();
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.A))
{
_animation.SetTrigger(Playing);
// _animation.ResetTrigger(Playing);
IDebug.Log("Playing animation ");
}
if (Input.GetKeyDown(KeyCode.R))
{
_animation.ResetTrigger(Playing);
IDebug.Log("reseting animation ");
}
}
}
