How to Raycast from the Player to detect a part under them?

Hey there, my game utilizes room generation and needs to keep the room that each player is in. I plan on using raycasting instead of .Touched event (due to a plethora of potential errors.)

So, I want to achieve a raycast from the players HumanoidRootPart down to a “detection” part with a value. Multiple times a second…

Is this possible?

yeah just do:

local studs = 100
local raycast = workspace:Raycast(root.Position, root.CFrame.UpVector * -studs, param)

2 Likes

make sure to set up your reference for raycast params lol

1 Like