I'm basically trying to recreate the "Shift mouse lock" feature, but without all the spazzy movement when turning, like this : http://www.roblox.com/Strife-ALPHA-place?id=178676905
And I'm rather very new to scripting with cameras. Anyone know what I'm doing wrong here?
local Input = game:GetService("UserInputService")
local Player = game.Players.Player1
local Camera = game:GetService("Workspace").CurrentCamera
local Mouse = Player:GetMouse()
local RootPart=workspace.Player1.Head
game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter
game:GetService("UserInputService").MouseIconEnabled = false
-- Input event handler for 3rd person
local AngleY = 0
Input.InputChanged:connect(function(InputObject)
if InputObject.UserInputType == Enum.UserInputType.MouseMovement then
AngleY = math.max(math.min((AngleY - InputObject.Delta.y/2), 55), -80)
end
end)
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CoordinateFrame = RootPart.CFrame * CFrame.new(0, 1.5, 0) * CFrame.Angles(math.rad(AngleY), 0, 0)

2 comments
Are you using a LocalScript for this? Just wondering as the Player variable doesn't reference the LocalPlayer.
Not as of now, I will though. But I just cant get the stable character movement.