Search the Community
Showing results for tags 'camera position'.
-
Hello good day / night guys, I am new on the comunity of babylonjs , really happy to have found a great tool to make some games , i have a concern about if there is a way that according to the camera.position.y it can change the scene's properties , for example like the fog if i am underwater and change it back to less fog if i am outside the water ? i've tried this : "scene.getCameraByName("FreeCamera").position.y<=0" and "scene.getCameraByName("FreeCamera").position.y>0" , but not sure if it is okey to set it inside the : scene.registerBeforeRender ? like this : scene.registerBeforeRender(function() { if(scene.getCameraByName("FreeCamera").position.y<=0){ // properties for camera when is inside water } if(scene.getCameraByName("FreeCamera").position.y>0){ // properties for camera when is outside water } }); will this affect performance? , or there is another way to detect camera positions to change properties according to the high level ? , thanks in advance
-
Hi, I am not sure if this is a bug. I am trying to increment both the position of the world camera and want to move all their displayed object update: function () { this.game.world.y = 100; console.log(this.game.world.y);},The position of the world is changed but the world did not move update: function () { this.game.camera.y += 1; console.log(this.game.camera.y);},This time, the camera only results to zero. I have tried moving the camera with Phaser 1.1.3 and it works. I am curious why this approach is not working for 1.2. Thank you