Answer the question
In order to leave comments, you need to log in
Bug (or stupid) with GetBool() in Unity 2020?
Hello! For some reason the negation of GetBool() does not work. Yesterday it worked, today it doesn't.
private Animator _doorAnimator;
private void Start()
{
_doorAnimator = GetComponent<Animator>();
}
public void DoorInteracting()
{
_doorAnimator.SetBool("IsDoorOpen", !_doorAnimator.GetBool("IsDoorOpen"));
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question