Need help with detecting nearby objects

Hmm, that could work, I’ll try it, thanks.

did i do anything wrong in my script? If I did then can u say what I did wrong?

No, don’t worry I just sent a reply to you instead of to the post.

I’m trying the method you suggested to me, and so far it is working nicely, however, how can I cast a ray from the left and right sides of the root part? as the part itself currently only goes from forwards and backwards.

This is my code:

local direction = (body.mtf.CFrame * CFrame.new(0, 0, -1000)).p --front
local direction2 = (body.mtf.CFrame * CFrame.new(0, 0, 1000)).p --backwards
local direction3 = (body.mtf.CFrame * CFrame.new(0, 1000, 0)).p --left/right?
local direction4 = (body.mtf.CFrame * CFrame.new(0, -1000, 0)).p --left/right?