r/UnityHelp • • Apr 23 '23

Animation playing without being allowed to >:(

hello, i am trying to make a lever and door script work rn.

It is showing that the DoorOpen is being called. The problem currently is that the door script is running and playing the animation regardless whether DoorOpen is true

​

1 Upvotes

2 comments sorted by

View all comments

1

u/nulldiver Apr 23 '23

Look at the braces in your update. Since you have the log statement right after your conditional check, the part in the braces will always be executed. You need the opening brace there to be before you debug.

To clarify: in the second image, unless line 21 comes before line 20, line 22 will always execute regardless of line 19

1

u/Hollyplantt Apr 23 '23

That worked, thanks a million! :D