Jump to content

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)



Link to comment
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

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.

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.


  • Recently Browsing   0 members

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