m0utz Posted February 2, 2016 Share Posted February 2, 2016 Hello, I'm trying to animate clones of an object but with a delay between animation. You can find a test here : http://www.babylonjs-playground.com/#ACLYP#1 But as you can see, the delay between animation is not constant, after the first loop, all animation are not sync, how can i keep the same delay after all the loop ? Maybe it's not the right way of doing this, can someone help me with this ? In this configuration I can keep the delay between animation but some of them never end : http://www.babylonjs-playground.com/#ACLYP#2 Thanks ! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 2, 2016 Share Posted February 2, 2016 Hey! Welcome:) What about this: http://www.babylonjs-playground.com/#ACLYP#3 m0utz 1 Quote Link to comment Share on other sites More sharing options...
m0utz Posted February 2, 2016 Author Share Posted February 2, 2016 Hey Deltakosh, thank you for watching my post but your solution is not really what i want to do. But I like the setTimeout trick I keep it in my mind for later user. What i try to do is having a continuous flow of sphere moving with a delay between them. I really can't understand why my first example don't keep the delay between animation after the first loop...http://www.babylonjs-playground.com/#ACLYP#1 Maybe because I use 190 for the end keyframe value, but when I put a variable (frame_fin) so the animation time is always 100 it doesn't work anymore... Thank you for your help (merci pour la bienvenue, et comme tu as pu le voir, j'ai nommé des variables en français....my bad and sorry for my english ) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 2, 2016 Share Posted February 2, 2016 My pleasure and what about this: http://www.babylonjs-playground.com/#ACLYP#4 Quote Link to comment Share on other sites More sharing options...
m0utz Posted February 3, 2016 Author Share Posted February 3, 2016 Hello Deltakosh, thank you for your help. I finally did approximatively what I wanted to do using your first solution with the setTimeout. This is the effect I was looking for : http://www.babylonjs-playground.com/#ACLYP#6 But as you can see the distance between 2 balls are not always equal depending on the pc I use, I think it's because setTimeout doesn't fire properly sometimes. And the last ball is near the first one. How can I have this effect with a perfect loop that respect the same space between spheres ? And to continue my test I made this : http://www.babylonjs-playground.com/#ACLYP#8 and I'm now working on a littre project using AudioContext and BabylonJS, I'll show you here when it's done Quote Link to comment Share on other sites More sharing options...
Temechon Posted February 3, 2016 Share Posted February 3, 2016 You could use a Timer I use for my prototypes: https://github.com/Temechon/screensaver/blob/master/js/Timer.js (ES6) Here is an example on how to use it : https://github.com/Temechon/screensaver/blob/master/js/Game.js#L131 (still ES6) m0utz 1 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.