Hi guys. Iv tried many things. This is the closest iv gotten. Look at this video I made on my YouTube channel. I recorded how the NPC functions. Just watch to understand.
✓ ANSWER ACCEPTED
How to make a raycast correctly?
1 answer
✓ Accepted answer
If you read through https://developer.roblox.com/en-us/api-reference/datatype/Ray, the 2nd argument to .new is direction, not targetLocation. You can see an example of how to use it here: https://developer.roblox.com/en-us/api-reference/function/WorldRoot/FindPartOnRay
I would recommend starting at the head of the character and progressing towards the RayDirection.Handle.Position, like this:
local startPos = script.Parent.Head.Position
local targetPos = script.Parent.RayDirection.Handle.Position
local ray = Ray.new(startPos, targetPos - startPos)
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Sorry but the recording software distorts my voice, or changes the frequency, btw sub to my channel pls
don't ask for youtube subs on scriptinghelpers
You have a good question, but you should post your script and the relevant details on the site in text, rather than in a video.