Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

3rd Person Camera Help?

Asked by 9 years ago

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)
0
Are you using a LocalScript for this? Just wondering as the Player variable doesn't reference the LocalPlayer. Spongocardo 1991 — 9y
0
Not as of now, I will though. But I just cant get the stable character movement. Orlando777 315 — 9y

Answer this question