vishnu Posted March 16, 2018 Share Posted March 16, 2018 Hey, I have using Free camera for my hunting game. var arrow = [ ]; var camera = new BABYLON.FreeCamera("FreeCamera", new BABYLON.Vector3(0, 2, -25), game_scene); camera.attachControl(canvas, true); BABYLON.SceneLoader.ImportMesh("", "", meshPath, game_scene, function (newMeshes, particleSystems, skeletons){ for(var i = 0; i < newMeshes.length;i++){ arrow[i] = newMeshes[i]; arrow[i].position = new BABYLON.Vector3(0,1.3,-24); arrow[i].rotation.z = Math.PI/2; } }); scene.onPointerMove = function (evt,pickResult){ if(arrow != null){ for(var i = 0; i< arrow.length;i++){ arrow[i].rotation.x = camera.rotation.x; arrow[i].rotation.y = camera.rotation.y; arrow[i].position.z = camera.position.z; } bow.rotation.x = camera.rotation.x; bow.rotation.y = camera.rotation.y; bow.position.z = camera.position.z+2; hunt_arrow(); } } i have added my code in pick to Move case? it's working in browser fast and flexible but in android device it's working too slowly... please give me any solution for this Wingnut 1 Quote Link to comment Share on other sites More sharing options...
waverider Posted March 16, 2018 Share Posted March 16, 2018 hello : ) i think you need this: engine.isPointerLock = true Quote Link to comment Share on other sites More sharing options...
vishnu Posted March 16, 2018 Author Share Posted March 16, 2018 Thanks @waverider it's working in web. it's not working mobile. waverider 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted March 16, 2018 Share Posted March 16, 2018 Slowly like fps is low of movement are slow but FPS is fine? Quote Link to comment Share on other sites More sharing options...
vishnu Posted March 17, 2018 Author Share Posted March 17, 2018 engine.isPointerLock = true it's working smoothly from web. but I need mobile camera rotation. all animations fbs are working correctly the camera rotation only problem for me any other idea... https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/Inputs/babylon.freeCameraMouseInput.ts i need touch to rotate continuously 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.