www.gamemaker3d.com/player?pid=052615663428
I've been working on a more advanced Third Person movement system for a long time. And now you guys can use it in your projects!
How it works is you have an invisible cube target connected to the player for the camera to look at, and an invisible cube for the camera to attach to that rotates around the player.
The movement itself has the player rotate according where the camera is looking and what key you're inputting, and adds velocity to the player in that direction using impulse.
Issues with impulse based movement I've seen (for example in the monster NPC from the First Person Shooter template) is that you can't cap impulse based movement, so it just keeps accelerating. In this case, I found a way by adding an opposing impulse whenever the velocity hits a value I don't want it to go beyond.
I had to use impulse movement in order to have the player move in the camera's direction, as incrementing the player's xyz values don't work since they're locked to their axis instead of the player's local axis according to the camera direction. The alternate xAxis,yAxis,zAxis values don't work either as the camera isn't able to rotate locally with the player. Impulse movement is the only one where the local axis works with a fixated axis.
Sprinting works by setting the max velocity cap to a higher value, and returning it to default when the sprinting key is released.
Jumping works by determining if the player is on the ground or not, if it is then it adds an impulse upwards to the player. If the player's not on the ground, it can't jump cause you don't want the player infinitely jumping in the air (unless you want, it's open source why not?)
Things I want to add:
-Interpolation between the player rotation and camera rotation (it's too snappy currently)
-Normalizing diagonal sprint values (sprinting speed doubles diagonally)
-Player rotating towards diagonal movement (it doesn't rotate to diagonal movement)
-Smoother/Slower mouse sensitivity
-Max camera rotation (it inverts if you look up or down too much)
-Locking cursor without limiting mouse input
-Removing mouse border
-Aim mode (player rotates with camera)
Some of these probably won't be possible due to the limitations of the Cyberix engine but I'll try.
I also want to make a First Person equivalent to this.
Let me know what improvements I can make.
old: