How Would Create Sway For A Shift Lock Camera

what do you want to achieve?

What is the issue?

  • I’m currently unable to achieve the swaying motion when shift lock is activated on my character. I’ve tried different scripts and methods I even made a post before this one, but I’m still not getting the desired effect.

What solutions have you tried so far?

  • I have tried to look for solutions on the Roblox Developer form and experiment with different methods, but I’m still unable to get the swaying motion to work.

Here is a sample of the code that I’ve tried:

if UserInputService.MouseBehavior == Enum.MouseBehavior.LockCenter then
		function BaseCamera:UpdateMouseBehavior()
	local blockToggleDueToClickToMove = UserGameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove

	if self.isCameraToggle and blockToggleDueToClickToMove == false then
		CameraUI.setCameraModeToastEnabled(true)
		CameraInput.enableCameraToggleInput()
		CameraToggleStateController(self.inFirstPerson)
	else
		CameraUI.setCameraModeToastEnabled(false)
		CameraInput.disableCameraToggleInput()
		
		if self.inFirstPerson or self.inMouseLockedMode then
			UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
			
			local Character = player.Character
			local RootPart = Character:WaitForChild("HumanoidRootPart")
			local Humanoid = Character:WaitForChild("Humanoid")
			local Camera = workspace.CurrentCamera
			
			Humanoid.AutoRotate = false
			
			local rx, ry, rz = Camera.CFrame:ToOrientation()
			a1 = game:GetService("TweenService"):Create(RootPart, TweenInfo.new(0.09), {CFrame = CFrame.new(RootPart.CFrame.p) * CFrame.fromOrientation(0, ry, 0)})
			a1:Play()
		else
			pcall(function()
				a1:Cancel()
				a1 = nil
			end)
			
			player.Character:WaitForChild("Humanoid").AutoRotate = true
			
			UserGameSettings.RotationType = Enum.RotationType.MovementRelative
			UserInputService.MouseBehavior = Enum.MouseBehavior.Default
		end
	end
end

Hey there, I did some looking around for a similar topic because I also had issues with something similar. Check out this post right here. Why does CameraOffset ruin shift lock? (Help Needed, bad.) - #11 by AndroidBoyz

If that doesn’t help, do you mind posting the rest of the script?

That is all i edited this issue is contained in the player module