I’m trying to get all 3D Objects intersecting with a GuiObject (in this instance a mobile cursor) however it is returning nil.
_G._Raycast = function(_range : number, _params)
_range = _range or 10000
local _cursor = _G._settings._EasyRaycast and Player.PlayerGui.HUD._mobileCursor or Player.PlayerGui.HUD._mobileCursor.Frame
local ray = workspace.CurrentCamera:ScreenPointToRay(_cursor.Position.X.Scale*_cursor.Size.X.Scale, _cursor.Position.Y.Scale*_cursor.Size.Y.Scale, 1)
local origin = ray.Origin
local direction = ray.Direction.Unit*_range
local raycast = workspace:Raycast(origin, direction, _params)
return raycast
end