agmcleod Posted December 21, 2014 Share Posted December 21, 2014 Hello, me again. Working on a top down game: http://projects.agmprojects.com/topdown/ After clicking Tap to Start, you should be able to click in a space, and the little cube in the center will follow. It's moving fine, but doesn't collide into other cubes or the walls on the edge. I have the collisionsEnabled on the scene, checkCollisions on each mesh, and added ellipsoid to the player & other cubes to be safe. Any ideas what I am missing? Here's the source if it's easier: https://github.com/agmcleod/wrathofthecube Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 21, 2014 Share Posted December 21, 2014 I feel that the player cube does not come into collision with other cubes as they are on top of the player. It is quite difficult to verify your scene with a lot of code to analyze. Trying to do a scene with the bare minimum by removing everything that is not necessary to analyze your code more easily.this.mesh.position.y = 2.5; // try higher values here Quote Link to comment Share on other sites More sharing options...
agmcleod Posted December 21, 2014 Author Share Posted December 21, 2014 Nope, they all sit on the ground . Can add a #debug to the URL in the scene & refresh. Disables movement controls and initializes with the freecam instead. Can move around and see they all have an equal bottom. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 21, 2014 Share Posted December 21, 2014 Can add a #debug to the URL in the scene & refresh. Disables movement controls and initializes with the freecam instead. Can move around and see they all have an equal bottom. Yes, but it does not withdraw the amount of code you have written. but this can help Quote Link to comment Share on other sites More sharing options...
agmcleod Posted December 21, 2014 Author Share Posted December 21, 2014 locally i tried having the player constantly moveWithCollisions 0.2x 0.2z, and yeah it hit a box, and shifted not 100% under, but maybe had 1/4 of the box still sticking up after. So the collision is definitely happening, just not the response I'm looking for. Adding checkCollisions = true to the ground plane (realized that's not in the CreateGround code of the engine), it works much better. Getting some really weird slow velocities though when approaching boxes, like it's lagging. But then when i move around some more, it moves smoothly, and goes right up to the edge of the box. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 21, 2014 Share Posted December 21, 2014 Here I have a scene that works with collisions that also uses moveWithCollisions source: http://www.castorengine.com/babylon/moveCharacter/Scene.js scene: http://www.castorengine.com/babylon/moveCharacter/ try add : this.mesh.ellipsoidOffset = new BABYLON.Vector3(0, 1.0, 0); Quote Link to comment Share on other sites More sharing options...
agmcleod Posted December 21, 2014 Author Share Posted December 21, 2014 Works a little better. I have it moving towards a corner when debug mode is on. Oddly though it moves up its Y coordinate once getting close to the corner. No meshes aside from the ground underneath the cube. I can force correct the y coordinate (as it should always be 0.5), but not sure if that's really ideal. 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.