Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Raycasting; how do I cast the ray this way?

So I've been working on an anti-exploit for a while and I found a loophole with one of my scripts.

local AntiRay1 = Ray.new(HumanoidRootPart.Position, HumanoidRootPart.CFrame.LookVector * 0.4)

^ That is the first ray to make sure items don't go inside the player How would I cast the ray, say, to the right of where the player is looking, or the left? Or even behind them?

(I checked the Dev Forum and Wiki but I couldn't find anything, that or I'm just blind)

1 answer

local TheRay = Ray.new(HumanoidRootPart.Position, HumanoidRootPart.CFrame.RightVector * 1)

I've found my solution

This discussion is preserved as it was. New answers, comments, and votes are closed.