How can I make the camera rotate in a fixed axis (First Person Mode)?

Well, as the title said, I want to make the player camera only rotate on the X-axis while Y-axis is locked. This type of camera was used in some games like Doom (old retroversion) and other games using ray casting. Sure I could try to use key binds but I want to make the camera moves using the mouse, how can I do this?

Check out this video https://www.youtube.com/watch?v=8_HUlchTZqs

I guess you can also multiple the camera look direction by a vector of:

Vector3.new(1, 0, 1))

This will remove the y-axis of the camera’s look direction like in doom.

Then you can achieve something similar to this CFrame rotation:

87e3a9a9ea9b255f74dd9e3ce43bf2d6be93b2a2

Since rotating the Camera operates in a similar fashion to CFrame manipulation since you need to control the position and orientation of the camera this neat property to remove the y-axis of the look direction should apply as well.

Thread where I limit the CFrame rotation which could apply for your camera’s CFrame rotation scenario as well.

2 Likes