Jump to content

How to delete an animation event


roman_44
 Share

Recommended Posts

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 by roman_44
Mistake in topic name
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...