N
N
ninrez2021-08-24 19:16:52
Unity
ninrez, 2021-08-24 19:16:52

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

1 answer(s)
G
GavriKos, 2021-08-24
@ninrez

100% stupid. What do you mean it doesn't work? Well, print out what it returns to you.
When boolean operations break, the world will collapse

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question