That’s correct and that’s the problem. You need an if statement in your update function (like you did before) to prevent the code is always executed.
1 Like
Oh, thanks
There are two ways to check if a key is pressed. With the event from your initialize function (for that you have to create an event function). Or with an if statement in your update function. You can see the code on the page below.
https://developer.playcanvas.com/en/tutorials/keyboard-input/
1 Like