eboo

how to detect animation end

Recommended Posts

i'm in trouble with a so stupid think that ... i m confused :P

but i'm moving mesh from A to B

i launch animation (skeleton1.beginAnimation("marcher");)

all is ok, my renderloop is ok

... but... if B is too far ... i'd like to make a loop. How can i detect the end of the animation.

I could try to use time to lanch animation ... but i d like to be able to switch animations (walk / run / use a horse / etc )

2 quesitons:

- is there a "skeleton1" parameter to detect "running " animation?

- or  is there a way to loop animations (until i decide to stop :p)

 

 

Share this post


Link to post
Share on other sites

You can use this parameter : http://doc.babylonjs.com/classes/2.2/Animatable#onanimationend-any

It's a function called when the animation is finished. Here is an example : http://www.babylonjs-playground.com/#1JYOZX#2

Here are some more examples : http://doc.babylonjs.com/playground?q=onanimationend

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

  • Recently Browsing   0 members

    No registered users viewing this page.