narkro555 Posted September 10, 2018 Share Posted September 10, 2018 EDIT: My previous demo might not have been clear; you need to click the screen and lock the cursor, then you can look around. To make this more apparent, I've increased the size of the ground plane. https://playground.babylonjs.com/#E8MQGK#2 My player object is a FreeCamera with an ellipsoid value of new BABYLON.Vector3(1, 4, 1). The object in question is a cube Mesh created with MeshBuilder.Box with an initial size of (1, 1, 1). Now ideally when the player walks and hits it, the player moves up it like a ramp (and would not do so for taller objects), but I would be fine at the moment if he just stopped smoothly as if he had hit a wall for the moment. However, the current result is that he seems to momentarily move on top of it, then zip back out as if to fix the fact that it had gone inside the bounding box. This results in a "spazzing" back and forth when walking towards this shorter object. The spazzing gets lesser as the cube gets taller, and goes away entirely when the object is at the same height, but it is still a very glaring issue given my plan. What should I do? On a side note, I followed an First Person Shooter tutorial (http://www.pixelcodr.com/tutos/shooter/shooter.html) to try and get myself started with what was supposed to be an example of good work, but the FreeCamera slows and eventually stops when pointing the view downwards. Can I get some tips on making a baseline FPS movement that works like your standard FPS would? Other examples I've found have this same issue. Quote Link to comment Share on other sites More sharing options...
Guest Posted September 10, 2018 Share Posted September 10, 2018 Hey! if you look at the Espilit demo on our homepage, you'll see that you can walk correctly everywhere and even walk up the stairs. This is basically because the entire scene use a 1 unit = 1 meter approach plus a scene.gravity set to a (0, -9.81, 0) Quote Link to comment Share on other sites More sharing options...
narkro555 Posted September 10, 2018 Author Share Posted September 10, 2018 That's strange, why is it working in the demo, but not in mine? I just now made a Playground: https://playground.babylonjs.com/#E8MQGK#1 to maybe help show the point. The demo also has the issue of slowing when you point down. Quote Link to comment Share on other sites More sharing options...
Guest Posted September 11, 2018 Share Posted September 11, 2018 I see nothing but a gray background in your demo Quote Link to comment Share on other sites More sharing options...
narkro555 Posted September 11, 2018 Author Share Posted September 11, 2018 4 hours ago, Deltakosh said: I see nothing but a gray background in your demo Ack, my bad. I should have been more specific. You need to click the screen and lock the cursor, then you can look down. I've updated the OP again. Very new to this sorry. Quote Link to comment Share on other sites More sharing options...
Guest Posted September 11, 2018 Share Posted September 11, 2018 Ok gotcha Well in our demo, there is only slope using planes and you can go over meshes (you can always try to increase the camera speed and reduce the gravity but it seems not what you want here) Quote Link to comment Share on other sites More sharing options...
dbawel Posted September 11, 2018 Share Posted September 11, 2018 I hold at a solid 60 fps. what device are you testing and what browser? DB Quote Link to comment Share on other sites More sharing options...
narkro555 Posted September 11, 2018 Author Share Posted September 11, 2018 37 minutes ago, dbawel said: I hold at a solid 60 fps. what device are you testing and what browser? DB Sorry again, FPS as in First Person Shooter, like the example project in the last paragraph. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted September 12, 2018 Share Posted September 12, 2018 When you look at the ground (almost full vertical or close), the direction (camera to where you look) projected on the ground will be pretty small (even 0 in case of pure vertical) . As this is what creates the current player movment, this could explain the speed difference. Quote Link to comment Share on other sites More sharing options...
narkro555 Posted September 13, 2018 Author Share Posted September 13, 2018 I just gave up and wrote my own gravity and jump script. Not sure why my collision would be glitchy like that when its fine everywhere else, but I'm satisfied with a custom one now. Thanks for all your help anyway. GameMonetize and Sebavan 1 1 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.