Vijay Kumar Posted February 12, 2016 Share Posted February 12, 2016 Can any help me ,how to make our FPS Camera (Free camera) to walk on steps Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 12, 2016 Share Posted February 12, 2016 Hi Vijay, there are a lot of demos online, Espillit (http://www.babylonjs.com/Demos/Espilit/) would be my favorite. If you want to share some code and show if something doesn't work, please do. Use the internal collisions system (here is a guide to get you started - http://doc.babylonjs.com/tutorials/09._Cameras,_Mesh_Collisions_and_Gravity) Enjoy! Quote Link to comment Share on other sites More sharing options...
Vijay Kumar Posted February 15, 2016 Author Share Posted February 15, 2016 Thanks RaananW. I would try to learn the camera movement form Espillit Scripts. Thanks for the suggestion. Quote Link to comment Share on other sites More sharing options...
gryff Posted February 15, 2016 Share Posted February 15, 2016 Hi Vijay - welcome to the community I created an example of climbing stairs for the "October Challenge" - creating a maze. Here is the link Maze The first part is an intro - let it play through and it will eventually drop you in a maze. You can open the gate by clicking on the lever - and walk up the stairs. The code you need is in the file draw.js which you can see in the web console in Firefox. In that file is a function - function drawStairs(...) { ....} Basically it creates a invisible slanted plane that you walk on but you see a staircase exactly where the plane is but that is collision disabled. The function actually creates four of them as well as the gates. And gravity has to be adjusted so that you can proceed up the plane. So for creating four sets of steps I use instances as the stair meshes are all the same and it allows for mesh efficiency. Try it - see if it helps. I have another example somewhere - but I have to find it - which I created a while back when I first tackled this same problem. cheers, gryff GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Vijay Kumar Posted February 15, 2016 Author Share Posted February 15, 2016 Hi Gryff, Thanks for the response. Friend i am facing issue in that demo , Not able to click the lever and mouse functions like rotation are also not working.i can only walk in that demo not able to rotate with mouse movements also. i have a doubt ,i am going through the tutorial (https://blogs.msdn.microsoft.com/davrous/2014/11/18/understanding-collisions-physics-by-building-a-cool-webgl-babylon-js-demo-with-oimo-js/) , i downloaded the visual studio solution also. i gone through main.js script there they just exported the scene but there also i didn't find anything related to camera walk on stairs. could anybody help me how that walking on stairs is working in that ESpilit project is there any code written in any other file or by using any existing methods in freecamera it is able to walk on stairs. Quote Link to comment Share on other sites More sharing options...
Vijay Kumar Posted February 15, 2016 Author Share Posted February 15, 2016 Hi Gryff, Your Demo is working now i am able to walk on stairs. but there is an issue friend when i stop in the middle of stairs again the player is falling back. 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.