Make the player unable to rotate camera, but still be able to follow the CameraSubject

Im trying to make a weapon where the player cannot rotate their camera and character when being activated. I used Enum.CameraType.Scriptable which works well but I need it to follow the CameraSubject.

Here is an example why changing to Enum.CameraType.Scriptable alone wont really work:

1 Like

Use ContextActionService and bound the RMB to a different action thus overriding the existing action RMB has (rotating the camera), you may need to do it for the various buttons which change the camera position too, alternatively you can set the CameraType to scriptable and fixate it on the player’s HMR at a distance.

3 Likes

The first method works well! but unfortunately it only really works in third person. What should I do so the player cant rotate in first person?

1 Like

You might need to prevent first person view, which you can do by setting minimum zoom distance to something above 0 I believe.

https://developer.roblox.com/en-us/api-reference/property/Player/CameraMinZoomDistance

2 Likes

thanks for your help, but I need to stop the camera rotation for first person view.

alternatively you can set the CameraType to scriptable and fixate it on the player’s HMR at a distance

I can try doing this, but im afraid it might mess up the camera

1 Like

try
Enum.CameraType.Attach
or
Enum.CameraType. Track
or
Enum.CameraType. Follow

1 Like