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

Custom camera rolling?

Asked by
Muoshuu 580 Moderation Voter
8 years ago

No idea why this is happening, the camera was working perfectly fine yesterday.


Basically, when turning, the camera rolls based on it's pitch (SetRoll is not used)

Example


CameraType is set to Scriptable, MouseBehavior is set to LockCenter


Game

Code

-- NewAngle = CFrame.Angles, Math.Radian = math.rad, InputChanged is called when the event 'UserInputService.InputChanged' is fired

local InputChanged = function(Input)
    if Input.UserInputType == Enum.UserInputType.MouseMovement then
        Camera.CoordinateFrame = Camera.CoordinateFrame * NewAngle(Math.Radian(-Input.Delta.Y/8), Math.Radian(-Input.Delta.X/8), 0)
    end
end

Answer this question