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

How do I get the position that a ray hits when raycasting?

I've looked around for an answer but I can't find much. I need to know how to get the position of where a ray hits or ends in the workspace. My guns use the raycast script from the roblox wiki.

1 answer

✓ Accepted answer
BasePart, HitPosition, RayPosition, HitmaterialOrTerrain = workspace:FindPartOnRay(ray)

2 comments

0

Thanks. I got what I needed to work. RayPosition seemed to be where the ray hit. Or the second value in other words.

0

Ya, I just knew it was instance,pos,pos,normal. Fixed it

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