First person camera w/ mouse controls
-
I’m making a fps (first person shooter), and I want the view to move with the mouse, but not have to click, like in free mode, have a limit to the v angle in which the camera looks at. and make the player move forward only based on the Z-rotation, not the x or y.
-
This seems very similar to the Minecraft demo, where you use “lock pointer” to control the camera view using the mouse pointer:
play.creaticode.com/projects/660aa865b57a3da838c387bc
To lock the vertical angle, a simple trick is to repeatedly set the camera’s v-angle to 90 degrees whenever it is not: -
@info-creaticode How would I change my follow camera’s v-
rotation? -
If you use the pointer lock, the v-angle will be automatically changed. But you said you want to limit the v-angle?
If you want it to move freely but within a range, you can still use the same block to set the v-angle whenever it is outside the range.