I've been making a game in Babylon.js. In my game, there is a place where I have put a height map, it shows up when I run the scene, but when I try walking on it (or just standing on it) I fall through. I have searched almost everywhere and I haven't been able to find out why. This is my code:
var ground = BABYLON.Mesh.CreateGroundFromHeightMap("ground", "Assets/Heightmap.png", 1000, 1000, 100, 0, 100, scene, false);
var groundMaterial = new BABYLON.StandardMaterial("ground", scene);
groundMaterial.diffuseTexture = new BABYLON.Texture("Assets/Sand.png", scene);
groundMaterial.diffuseTexture.uScale = 50.0;
groundMaterial.diffuseTexture.vScale = 50.0;
ground.position.y = -2.0;
ground.material = groundMaterial;
Then I run this:
var gravityVector = new BABYLON.Vector3(0,-9.81, 0);
var physicsPlugin = new BABYLON.CannonJSPlugin();
scene.enablePhysics(gravityVector, physicsPlugin);
After all of that, I try to run a BABYLON.PhysicsImposter for the ground but it doesn't work. So far I have tried the BoxImposter, MeshImposter, and HeightMapImposter. None of them worked for me.
I am eager to get an answer, thanks in advance.