Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 6 years ago

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

Log in to vote
1
Answered by
Bellyrium 310 Moderation Voter
6 years ago
Edited 6 years ago
BasePart, HitPosition, RayPosition, HitmaterialOrTerrain = workspace:FindPartOnRay(ray)
0
Thanks. I got what I needed to work. RayPosition seemed to be where the ray hit. Or the second value in other words. Jesse1240 59 — 6y
0
Ya, I just knew it was instance,pos,pos,normal. Fixed it Bellyrium 310 — 6y
Ad

Answer this question