Camera Manipulation Question

Hi, How to make a player to not be able to walk but they can rotate themselves while on scriptable camera?

Set their Humanoid’s WalkSpeed to 0.

You can anchor the HumanoidRootPart and leave the camera to custom.

This works but then how do I let the Humanoid to rotate?

You could force them to do ShiftLock if that’s possible. You’d probably have to make a custom shift lock.

I’m unsure what you mean, Do you mean letting the players mouse be free while them not being able to move?

If so:

local Controls = require(Player.PlayerScripts.PlayerModule):GetControls()
Controls:Disable() -- Disables player controls. (Jump, Walk, etc)

local Camera = workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = workspace.CameraPart.CFrame -- Setting the camera's CFrame to a object.

I’m making a player editor system. When player click the editor they will be lock on one side of the editor gui. Where they can rotate the character so they can see their back, side and front but not be able to move or jump etc. Here’s my script.

	camera.CameraType = Enum.CameraType.Scriptable
		
	local bCFrame = primaryPart.CFrame * CFrame.new(0,0.3,-7) * CFrame.Angles(math.rad(0), math.rad(145), math.rad(0))
			
	local tween = tweenService:Create(camera, TweenInfo.new(2), {CFrame = bCFrame})
	tween:Play()
	
	humanoid.WalkSpeed = 0
local Controls = require(Player.PlayerScripts.PlayerModule):GetControls()
Controls:Disable() -- Disables player controls. (Jump, Walk, etc)

local Camera = workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CameraSubject = -- Player or you're character
1 Like

Anchor the HRP and make the character rotate when they click an arrow instead of rotating, this would be an easier way, I suppose. This would also work more efficiently since if you were to lock shiftlock like @Ty_Scripts suggested, the player won’t be able to access the buttons as easily.

Thanks for the suggestion. I will try different things and see which will work for me.

I wouldn’t advise you to use PlayerModules for disabling controls. It’s a working yet to some extent unreliable way, since PlayerModules are subjects to change. They might be updated, eventually moved, methods might change, and so on. That might happen soon, perhaps once in the following months, maybe never. Nevertheless, even though it works, it’s probably better to use this alternative:

local CAS = game:GetService("ContextActionService")

local function freezeMovement(sinkActions)
	if (sinkActions) then
		CAS:BindActionAtPriority(
			"DisabledControls",
			function() return Enum.ContextActionResult.Sink; end,
			false, Enum.ContextActionPriority.High.Value +1,
			unpack(Enum.PlayerActions:GetEnumItems())
		)
	else
		CAS:UnbindAction("DisabledControls")
	end
end

-- Usage:
freezeMovement(true) -- freeze controls
freezeMovement(false) -- unfreeze controls

The above function is bound to inputs of all character movement buttons. Before other scripts could register any input, actions are sunk. Sunken actions are ended. Character is still free to rotate, unless camera is set to scriptable.