#Can anyone explain me this script?

1 messages · Page 1 of 1 (latest)

lament scarab
#

I know this is a camera movement script that moves the camerapart relative to how far the mouse is from the X and Y screen center but I get lost on why the math.rads and angles and multiplication stuff... I am bad at math and I don't understand what's going on there at all

local v1 = workspace.Camera
local TweenService = game:GetService("TweenService")
local SoundService = game:GetService("SoundService")
local RunService = game:GetService("RunService")

local LocalPlayer = game.Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()

local CFRame = workspace.Camarah.CFrame

RunService.RenderStepped:Connect(function(p11)
    v1.CameraType = Enum.CameraType.Scriptable
    v1.CFrame = v1.CFrame:Lerp(
        CFRame * CFrame.Angles(
            math.rad(
                (Mouse.Y - Mouse.ViewSizeY / 2) / Mouse.ViewSizeY * -14), 
            math.rad((Mouse.X - Mouse.ViewSizeX / 2) / Mouse.ViewSizeX * 
                -14), 
            0) 
            + 
            Vector3.new((Mouse.X - Mouse.ViewSizeX / 2) / Mouse.ViewSizeX * 4, 
                (Mouse.Y - Mouse.ViewSizeY / 2) / Mouse.ViewSizeY * 4, 
                0
            ), 
        p11 * 2)
end)
hollow scaffold
#

math.rad converts degrees to radians

#

its just math

lament scarab
#

Is that bad?

#

Should I be conformed by only knowing the proposite of the script?

hollow scaffold
#

i can suggest splitting out all those formulas into separate variables