I wish to improve the third person over the shoulder script I currently possesses. I want it so that instead of the whole player’s body moving with the mouse as the character rotates, only the torso rotates until reaching a certain point. I think that locking the mouse to the middle of the screen is the main problem, as if this was fixed I could make the player’s torso rotate to the mouse, but do not know any other methods to lock the mouse to the middle.
Script:
local player = game:GetService(“Players”).LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild(“Humanoid”)
local PlayerModule = game.Players.LocalPlayer.PlayerScripts:WaitForChild(“PlayerModule”)
local cameras = require(PlayerModule):GetCameras()
local CameraController = cameras.activeCameraController
local RunService = game:GetService(“RunService”)
toggle = true
game.ReplicatedStorage.cameraEnable.OnClientEvent:Connect(function()
CameraController:SetIsMouseLocked(true)
humanoid.CameraOffset = Vector3.new(1.5,1,0)
player.CameraMaxZoomDistance = 10
player.CameraMinZoomDistance = 10
end)
game.ReplicatedStorage.cameraDisable.OnClientEvent:Connect(function()
CameraController:SetIsMouseLocked(false)
humanoid.CameraOffset = Vector3.new(0,0,0)
player.CameraMaxZoomDistance = 70
player.CameraMinZoomDistance = 0
end)