I’m going to create a TPS/FPS game using Babylon.js
I try to let players (boxes) stand upright and stack together after collision detection by physics engine. However, the reaction force makes them bounce and slide:
I use object.rotationQuaternion.x = 0; and object.rotationQuaternion.z = 0; in the register before render function. object.rotationQuaternion.y = 0; would prevent the player from looking sideways.
But that might be an issue, as I use 2 spheres and a cylinder to make a capsule, and a custom movement function. Also, good luck finding a solution to slopes! aka “stair clipping”. One way is to turn off gravity when on slopes. My fps is going to be different from others just so I could avoid that issue. Can’t wait to see it come out!
You can announce it under the games/projects category on the forums!
I was stuck on looking left/right when stopped because I used .sleep when not moving to prevent sliding down slopes. I didn’t find a solution, but feel free to copy any code you like. giv0.gitlab.io/fpsg (wait for the model city to load) was my first fps attempt. because it uses the default camera movement/gravity, jumping is not possible. Controls:
WASD move
C toggle crouch
SHIFT run
F toggle freecam
RIGHT CLICK aim