CodeIain Posted November 13, 2018 Share Posted November 13, 2018 Hi all, I have been banding my head against a wall all day with this. Am trying to apply physics to my mesh so the feet bones need to be on the ground or the robot will tip over but I just cant work out how i can apply the collision detection to the legs and apply gravity to the whole robot. you can find an example below https://www.babylonjs-playground.com/#D4ZZ8#50 any help would be great Quote Link to comment Share on other sites More sharing options...
trevordev Posted November 13, 2018 Share Posted November 13, 2018 @Codelain You should try looking at https://doc.babylonjs.com/how_to/using_the_physics_engine . Parenting with physics can have some unexpected behavior sometimes so you might have to experiment with the settings to get it to work. Quote Link to comment Share on other sites More sharing options...
CodeIain Posted November 14, 2018 Author Share Posted November 14, 2018 @trevordev I have read the docs, and based on this example https://playground.babylonjs.com/#PRHF00#6 my code should work but I cant figure out whats wrong with it. If I remove the parenting then my meshes explode but if i set the parent then collision is only applied to the parent. https://www.babylonjs-playground.com/#J1RNQW#18 Quote Link to comment Share on other sites More sharing options...
trevordev Posted November 14, 2018 Share Posted November 14, 2018 @codelain In your example you also want to move the objects which doesn't seem supported by this pg: https://playground.babylonjs.com/#PRHF00#11 . There is definitely some weird behavior when trying to do more complex interactions with physics and I am not yet sure how to resolve this type of collision but I am also investigating adding AmmoJS physics to Babylon (https://github.com/BabylonJS/Babylon.js/issues/3079), through my investigation there I'll keep an eye out there to see if your scenario can be supported but for now this may be a limitation. Quote Link to comment Share on other sites More sharing options...
trevordev Posted November 14, 2018 Share Posted November 14, 2018 Pinging @RaananW if he has any insight here. Quote Link to comment Share on other sites More sharing options...
trevordev Posted November 14, 2018 Share Posted November 14, 2018 @Codelain this playground may also be of use to you: https://www.babylonjs-playground.com/#UGMIH#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.