roman_44 Posted June 3, 2016 Share Posted June 3, 2016 (edited) Hey Babylon citizens! Hope you are all doing well! I have this piece of code: var animation = cameraAnimation.getAnimations()[0]; var endOfPartialAnimationEvent = new BABYLON.AnimationEvent( myDynamicValueOfTheFrame, function() { do something }, true); animation.addEvent(endOfPartialAnimationEvent); I need to delete this event from animation at some point of time. And I don't know how to do that. Problem is when I runs this code multiple times, all this events are still on my animation, but I do need only last one. So how can I delete for example all existing events on my animation? Thanks! Edited June 3, 2016 by roman_44 Mistake in topic name Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 3, 2016 Share Posted June 3, 2016 Hey just use this: http://doc.babylonjs.com/classes/2.4/Animation#removeevents-frame-rarr-void RTFM? roman_44 1 Quote Link to comment Share on other sites More sharing options...
roman_44 Posted June 3, 2016 Author Share Posted June 3, 2016 Sorry, my fault. Devs are lazy, don't want to read manuals Is there any way to delete all events from given animation? Because events are created dynamically from user input. So with removeEvents(frame) I have to track frames also because I don't know when user will create the event while animation is playing. Quote Link to comment Share on other sites More sharing options...
roman_44 Posted June 4, 2016 Author Share Posted June 4, 2016 Anyway I started tracking all frames and then deleting them in appropriate way. So thanks. Problem solved... GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.