Herbert Posted November 21, 2017 Share Posted November 21, 2017 Hey guys I try to make a simple sport game, so first, I want to make a person stand on a ground who can run and jump on it, and I have trouble on the jump part, the dude won't stop by the ground when he is dropping from a height(https://www.babylonjs-playground.com/#1BZJVJ#113) if the position.y is 0, then the dude can stand fine on the ground Quote Link to comment Share on other sites More sharing options...
mr_pinc Posted November 21, 2017 Share Posted November 21, 2017 You just need to use the PlaneImposter instead https://www.babylonjs-playground.com/#1BZJVJ#114 Quote Link to comment Share on other sites More sharing options...
Herbert Posted November 21, 2017 Author Share Posted November 21, 2017 hi @mr_pincPlaneImposter works, but I got this warning(confused "Attention, PlaneImposter might not behave as you expect. Consider using BoxImposter instead" Quote Link to comment Share on other sites More sharing options...
mr_pinc Posted November 21, 2017 Share Posted November 21, 2017 Sure but then you need to create a box rather than a plane. Herbert 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted November 21, 2017 Share Posted November 21, 2017 or else : http://doc.babylonjs.com/classes/3.1/groundmesh#getheightatcoordinates-x-z-rarr-number JackFalcon 1 Quote Link to comment Share on other sites More sharing options...
Herbert Posted November 22, 2017 Author Share Posted November 22, 2017 @mr_pinc well...but that is a ground, it is weird to use a box to replace it, I think I'll ignore the warning and go for PlaneImposter Quote Link to comment Share on other sites More sharing options...
Herbert Posted November 22, 2017 Author Share Posted November 22, 2017 @jerome what do you mean? you mean I can use getHeightAtCoordinates to resolve it? or you mean I can use groundMesh instead of a plane? it is groundMesh already just I named it plane Quote Link to comment Share on other sites More sharing options...
jerome Posted November 22, 2017 Share Posted November 22, 2017 If you use a GroundMesh (whatever its name), you can get the ground altitude y at any (x, z) 2D coordinates. In other terms : if your buddy y position is higher than the altitude at buddy position (x, z) then he's above the ground, he can keeping falling else ... up to you Herbert 1 Quote Link to comment Share on other sites More sharing options...
Herbert Posted November 24, 2017 Author Share Posted November 24, 2017 @jerome oh, got it, you mean I can detect it and control it by myself, then I think getHeightAtCoordinates will be a useful function, but I expect imposter to do these works for me, so I will just go for PlaneImposter. 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.