amorgan Posted January 17, 2015 Share Posted January 17, 2015 So in the examples we have://Then add the animation object to box1box1.animations.push(animationBox);which means it is an array, but if I create another animation and push it how do I actually call just one animation to play with beginAnimation()? for example://Then add the animation object to box1box1.animations.push(animationBox1);//Add another animation to box1box1.animations.push(animationBox2);//how can I just dobeginAnimation(box.animations[0],...);Or was it even meant to single out playing one animation if there are more than one attached to the mesh? I can, of course, just overwrite box1.animations[0] with the animation I want, but that seems unnecessary. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 17, 2015 Share Posted January 17, 2015 You can directly call animate on animationBox1: public animate(delay: number, from: number, to: number, loop: boolean, speedRatio: number) Quote Link to comment Share on other sites More sharing options...
iiceman Posted January 17, 2015 Share Posted January 17, 2015 I would like to do that, too, but somehow I don't get it to work. I always get a "can't set property X of undefined" error when I try it. I guess I got something wrong... here is a playground that illustrates the problem: http://www.babylonjs-playground.com/#24SBV7#8 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 18, 2015 Share Posted January 18, 2015 Far better:http://localhost:49482/Playground/index%20-%20debug.html#24SBV7#11 Quote Link to comment Share on other sites More sharing options...
jerome Posted January 18, 2015 Share Posted January 18, 2015 tttt tttt tttt "localhost" ? iiceman and Temechon 2 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 19, 2015 Share Posted January 19, 2015 Works better on official playground http://www.babylonjs-playground.com/#24SBV7#11 amorgan and iiceman 2 Quote Link to comment Share on other sites More sharing options...
iiceman Posted January 19, 2015 Share Posted January 19, 2015 Great, thank you! That makes it a lot easier amorgan 1 Quote Link to comment Share on other sites More sharing options...
amorgan Posted January 19, 2015 Author Share Posted January 19, 2015 I wanted to expand it out just for my own sake and to show how you could still use this to directly run an array of specific animations (and not just one, though running specifically one is the main goal of the thread). Also added the callback function for completeness http://www.babylonjs-playground.com/#24SBV7#15 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.