syed samoon Posted November 20, 2017 Share Posted November 20, 2017 Hi friends, I'm new to babylon js. i want to add a slope the player want to jump from that. but i don't know how to add this. Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 20, 2017 Share Posted November 20, 2017 Howdy! To get a slope working (assuming you really want to jump, like ice skating or something) you will need a physics engine . Here is a 101 course - http://doc.babylonjs.com/how_to/using_the_physics_engine Hope this helps! Quote Link to comment Share on other sites More sharing options...
syed samoon Posted November 20, 2017 Author Share Posted November 20, 2017 15 minutes ago, RaananW said: i will add physics engine to player. but what type of collider should be used for slope Quote Link to comment Share on other sites More sharing options...
syed samoon Posted November 20, 2017 Author Share Posted November 20, 2017 if i use mesh imposter the person goes through the slope. not jumping. Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 20, 2017 Share Posted November 20, 2017 The mesh impostor collides only against spheres, so your person should be a sphere Quote Link to comment Share on other sites More sharing options...
syed samoon Posted November 21, 2017 Author Share Posted November 21, 2017 No Quote Link to comment Share on other sites More sharing options...
Spankied Posted November 21, 2017 Share Posted November 21, 2017 The sphere, mesh impostor, will act as your character. Quote Link to comment Share on other sites More sharing options...
syed samoon Posted November 21, 2017 Author Share Posted November 21, 2017 thanks. i have a doubt how to freeze rotation in y & z axis only i'm using canonjs engine Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 21, 2017 Share Posted November 21, 2017 you could force a reset of the rotation every frame (will be the easiest thing to do actually). If you want to share a playground, we will be able to easily help you and show you how this might work. Quote Link to comment Share on other sites More sharing options...
syed samoon Posted November 22, 2017 Author Share Posted November 22, 2017 thanks it was fixed player.physicsImpostor.executeNativeFunction(function (world, body) { body.fixedRotation = true; body.updateMassProperties(); }); RaananW 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.