dav74 Posted December 1, 2013 Share Posted December 1, 2013 Hi,I'm trying gravity on a freeCamera :var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); var scene = new BABYLON.Scene(engine);var camera = new BABYLON.FreeCamera("FreeCamera", new BABYLON.Vector3(0, 15, 0), scene);camera.attachControl(canvas);var light = new BABYLON.PointLight("pointLumineux1", new BABYLON.Vector3(100, 100, 0), scene); var plan=BABYLON.Mesh.CreatePlane("sol",200,scene);plan.rotation.x=Math.PI/2;var cube=BABYLON.Mesh.CreateBox("boite",5.0,scene)cube.position.z=40;var mat= new BABYLON.StandardMaterial("matCube",scene);mat.diffuseColor = new BABYLON.Color3(1,0,0);cube.material=mat;scene.gravity = new BABYLON.Vector3(0, -10, 0);camera.applyGravity = true;engine.runRenderLoop(function () { scene.render(); });camera don't fall, why ?thank you for your help Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 1, 2013 Share Posted December 1, 2013 Even when you move? Quote Link to comment Share on other sites More sharing options...
dav74 Posted December 1, 2013 Author Share Posted December 1, 2013 Hi DeltaKosh and thank you for your answer,I understood :- when i move camera : nothing, the camera doesn't fall- when i add a line : "camera.checkCollisions = true;" all is ok : the camera falls GameMonetize 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.