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 7 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
7 years ago
Edited 7 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 — 7y
0
Ya, I just knew it was instance,pos,pos,normal. Fixed it Bellyrium 310 — 7y
Ad

Answer this question