Location of Body Rotation in Roblox's' Default Camera Scripts for Shift Lock Mode

Hey all,

I have a gun system that currently forces shift lock for most of the gun’s mechanics (it sets the mouse lock property).
This is the line of code that does this in the camera:Update() method


It works, great. The mouse is locked, and the player rotates with it.
I however wont a mode where the mouse (and camera) are locked but the player Does Not turn. As like a way to look around with aiming. I have an idea to accomplish this but it requires me finding out where the positioning of the camera in shift lock mode is located.

If anyone can direct me to where that it’s it’d help a lot!

as for that I’ve found a relevant post here
that basically explains how you’d go about getting all player actions or alternatively just disabling the script responsible for movement, but the second solution is outdated and you can replace master control with control module instead, or try anchoring the humanoid root part temporarily.


Hello. If you want to avoid that the character rotates automatically, just set the Humanoid’s AutoRotate property to false.
This way, the character won’t face the walking direction or the camera (in first person or when the mouse is locked).

1 Like

Oh wow! I didn’t realize it was that simple. Changing the humanoid’s auto rotate property spaced me. Appreciate it, works like a charm! Here I thought I’d have to make some huge edits to the scripts!

However one thing, this works well with preventing rotation but it does stop movement all together where the player faces the walk vector. Is there any way around this?