DellaFree Posted July 30, 2015 Share Posted July 30, 2015 Hi everybody !I've made this playground http://www.babylonjs-playground.com/#1PTVTW#1 ; as you can see, the "ships", start moving from a random position and finally arrive to the target position (the cylinder in the middle). I would understand some things: first,how can I stop moving the ships when they arrive on the heightMap, (imagine a ship that arrives on an island)? I use the actionManager , and , to understand how it works, I change the color from yellow to red,but they change too early. Actually I would that they stop when they reach the island (and not that change color); but I don't know how I can do that. Also I would understand how can I move these ships not at the same time (in my PG, they start all at the same time), but I would that they start moving in different time (with a random time); for example : the first ship starts after a 1s, the second after 2s, the third after 1.8s etc.Do you think that my approach is correct, or I should use another way to achieve these things ? All the suggestions will be appreciate Again, thanks for all guys,cheeers Quote Link to comment Share on other sites More sharing options...
DellaFree Posted July 31, 2015 Author Share Posted July 31, 2015 Hi ! I've noticed that BABYLON.StopAnimationAction is exacly what I need, but also the ships stop moving too early. Here is the PG : http://www.babylonjs-playground.com/#1PTVTW#2. Any idea on how to solve the other problems (the fact that they stop to early and how to move them on different time)?Thanks a lot guys,cheers Quote Link to comment Share on other sites More sharing options...
iiceman Posted July 31, 2015 Share Posted July 31, 2015 Hey Della, cool demo. I love the ships, they look really cool I don't have much time to play around now, but they ships stop on collision with the bounding box it seems. Edit: this seems related http://www.html5gamedevs.com/topic/15713-more-precise-collisions/ But I didn't get onCollide to work in the playground Quote Link to comment Share on other sites More sharing options...
iiceman Posted July 31, 2015 Share Posted July 31, 2015 I played around with ray casting to make them "look ahead": http://www.babylonjs-playground.com/#1PTVTW#5 Could be okay, right? Edit: with the random delay: http://www.babylonjs-playground.com/#1PTVTW#6 DellaFree and jerome 2 Quote Link to comment Share on other sites More sharing options...
DellaFree Posted August 1, 2015 Author Share Posted August 1, 2015 Hi @iiceman, thanks for your replay. That's excacly what I need It works fine. Really thanks. I think this topic is solved.Just out of curiosity, I added a lots of ships on this PG http://www.babylonjs-playground.com/#1PTVTW#7, and I would like to know if there is a way to avoid that the ships arrive in the same position, and "crash" one against the other (some ships overlap).Is this possible?Anyway, thanks a lot again,cheers jerome 1 Quote Link to comment Share on other sites More sharing options...
iiceman Posted August 2, 2015 Share Posted August 2, 2015 Maybe you could use ray casting again to look out for ships. Babylon JS also has the moveWithCollisions function. maybe you can check that out and see if that helps you? 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.