Jump to content

Search the Community

Showing results for tags 'applygravity'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 2 results

  1. Hello, When I am using free camera and attached controls, camera is falling only for about 1 second and than stops. I have to press control key to begin falling again. Can increase this duration or give camera instruction to fall (something like moveWithCollisions )? http://www.babylonjs-playground.com/#21AD8N Thanks!
  2. Hi, I trying to create a similar game for learn BabylonJS. I want to create a short game with dynamic objects. I can set the gravity to scene and camera but I can't to any meshes. So camera.applyGravity = true; working fine, but box.applyGravity = true; is ignored. My box still as a static mesh, gravity has no effect to the box. Is it possible to implement gravity on meshes? Am I on the bad way? My scene code below: var createScene = function (engine) { //Creation of the scene var scene = new BABYLON.Scene(engine); //Adding of the light on the scene var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(0, 100, 100), scene); //Adding of the Arc Rotate Camera //var camera = new BABYLON.ArcRotateCamera("Camera", 0, 1, 100, new BABYLON.Vector3.Zero(), scene); var camera = new BABYLON.FreeCamera("FreeCamera", new BABYLON.Vector3(0, 10, -20), scene); var box = BABYLON.Mesh.CreateBox("Box", 6.0, scene); box.position = new BABYLON.Vector3(0, 20, 0); var ground = BABYLON.Mesh.CreatePlane("Plane", 50.0, scene); ground.rotation.x = Math.PI/2; ground.position = new BABYLON.Vector3(0, 0, 0); //COLLISIONS BY GRAVITY //--------------------- //Set gravity to the scene (G force like, on Y-axis. Very low here, welcome on moon) scene.gravity = new BABYLON.Vector3(0, -1, 0); // Enable Collisions scene.collisionsEnabled = true; //Then apply collisions and gravity to the active camera camera.checkCollisions = true; camera.applyGravity = true; //Set the ellipsoid around the camera (e.g. your player's size) //camera.ellipsoid = new BABYLON.Vector3(1, 1, 1); box.checkCollisions = true; box.applyGravity = true; //finally, say which mesh will be collisionable ground.checkCollisions = true; return scene;}
×
×
  • Create New...