Sign in to follow this  
kzar

Making animations die

Recommended Posts

Hi in my animation class I added a loop option so you can make an animation only play through once or carry on forever. But I would like to make it so if the animation only plays once at the end it is removed. I searched around a bit and I read that making class's "suicide" is bad practice for a few different reasons. So how could I do this? Thanks, David

Share this post


Link to post
Share on other sites
mark your animation as "dead" (bool alive=false) and dont update/render/etc. dead animations. remove dead animations from animation list after update/render loop.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this