Have u ever considered skipping all this atan2 crap and just making the x and y range 1 by dividing it by the resolution then using that as the basis of the cameras rotation? Say you linear interpolate the rotational component with 180/pi * 15 + (180/pi * -15 - 180/pi * 15) * t
The math isn’t super complicated but what CoderHusk is getting at is you are just taking a value and scaling it. Just note that the GuiElement needs to have its Anchor Point set to 0.5,0.5 for this to work correctly.
local function parallaxEffect(EffectIntensity)
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local percentX, percentY = ((Mouse.X / Mouse.ViewSizeX)-0.5)*EffectIntensity+0.5, ((Mouse.Y / Mouse.ViewSizeY)-0.5)*EffectIntensity+0.5
return percentX, percentY