PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

UnitRay

Mouse

Ray

The UnitRay property is a DataType/Ray directed toward the Mouse's position in 3D space (described by Mouse/Hit). It originates from the Camera/CFrame|CFrame of the Workspace/CurrentCamera. Like all unit rays, it has a distance of 1.

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local mouse = player:GetMouse()
print(mouse.UnitRay.Direction.magnitude) -- Always 1