Quick actions

cmd+k|ctrl+k

Navigation

Languages

MouseMovementFixUWP

Snippet info

Language

Lua

Visibility

public

Author

legacy-v1-16166

Created

2023-08-03T05:22:41.299134Z

Updated

2023-08-03T05:22:41.299134Z

local WS = game:GetService("Workspace")
local UIS = game:GetService("UserInputService")

local Camera = WS.CurrentCamera

local LookAt = function(Point)
    local PointRay = CurrentCamera:ViewportPointToRay(Point.X, Point.Y)
    
    CurrentCamera.CFrame = CFrame.lookAt(CurrentCamera.CFrame.Position, PointRay.Origin + PointRay.Direction)
end

getgenv().mousemoverel = function(X, Y)
    LookAt(UIS:GetMouseLocation() + Vector2.new(X, Y))
end

getgenv().mousemoveabs = function(X, Y)
    LookAt(Vector2.new(X, Y))
end
INFO