Character Rotation script is breaking seats!

I have a problem with a Over-The-Shoulder script that I made! Whenever I want to rotate my character, the character rotates fine, but when I sit down in a seat, the seat rotates along with my character, and it’s a Game-Breaking glitch! But I don’t know how to fix it.

How would I make it so the character rotates like this one from the video, but stops rotating when I sit down, but then rotates again when I’m not sitting anymore?

Footage:
robloxapp-20240629-0832205.wmv (1.9 MB)

Script in StarterCharacterScripts:

local XAxis = 4
local RunService = game:GetService("RunService")

local function GetUpdatedCameraCFrame(root, CAMERA)
	return CFrame.new(root.Position, Vector3.new(CAMERA.CFrame.LookVector.X * 90000, root.Position.Y, CAMERA.CFrame.LookVector.Z * 90000))
end

RunService.RenderStepped:Connect(function()
	workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame*CFrame.new(XAxis,0,0)
	local Character = game.Players.LocalPlayer.Character
	local HumanoidRootPart = Character.PrimaryPart

	HumanoidRootPart.CFrame = GetUpdatedCameraCFrame(HumanoidRootPart, workspace.CurrentCamera)
	game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter
end)
3 Likes
RunService.RenderStepped:Connect(function()
local Character = game.Players.LocalPlayer.Character
if Character.Humanoid.Sit then return end
end)
2 Likes

Omgosh, thank you so much kind sir!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.