Sonic_Serpentine Posted December 23, 2016 Share Posted December 23, 2016 Hey guys, first post, started using Babylon Friday, so I may be a little green. I'm done waiting for Unity3D's webgl porting to not be a steaming pile. Really liking everything so far, but I could use some advice on moving forward with an FPS camera. I extended it from the BABYLON.FreeCamera. Nailed down most of it, but realized that the built-in collision the camera uses has no real concept of friction. It's going to be a bit of a problem when I intended on having moving floor platforms. They just slide right out from under you as-is. I'd rather not start from scratch or fall back on TargetCamera because of all the input groundwork that FreeCamera provides. My best guess for moving forward is to dig in and start overriding the collision functions of FreeCamera like _collideWithWorld(), _updatePosition(), etc. and replace them with Oimo compatible logic. I just want to get the problem out there before I go down that rabbit hole. Is this a horrible idea? Or maybe I'm just missing something incredibly obvious about the built-in physics? Thanks in advance for any advice. Quote Link to comment Share on other sites More sharing options...
Noyogi Posted December 23, 2016 Share Posted December 23, 2016 I'm a complete noob, so please let me know if I am missing something. Could you create a mesh like a box and have the physics that you wanted applied to the camera applied to the box instead, then have the box be the camera's parent, I think this is the work around that I see suggested when people are having issues with the camera not behaving as one might expect. Wingnut and Pryme8 2 Quote Link to comment Share on other sites More sharing options...
Sonic_Serpentine Posted December 26, 2016 Author Share Posted December 26, 2016 Well thank you, that helped me troubleshoot things initially. It turns out adapting the player rig collision to a physics plugin wasn't the way to go. It more or less did what I wanted in terms of sticking to platforms, but raised all sorts of problems with basic motion. Manually applying the platform's velocity to the player rig while being stood upon or leapt from turned out to be much simpler. And now I'm off to write jump pads! Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted December 27, 2016 Share Posted December 27, 2016 yes thats how you would do it. 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.