I want to register an action like, when user press ‘space’ key this animation ( or this action before rendering) will be disposed. How can I do that
1 Like
-
You have https://doc.babylonjs.com/api/classes/babylon.scene#onkeyboardobservable to detect the event (maybe there’s a better way, haven’t done this in Babylon)
-
Then you can https://doc.babylonjs.com/api/classes/babylon.scene#unregisterbeforerender the action, or just toggle a flag “do not play the animation”
2 Likes