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

[SOLVED]Ray stops after it hits something?

Asked by 6 years ago
Edited 6 years ago

So i'm shooting a ray from the camera to the Mouse position, it when it hits something it doesn't keep going like a normal ray, i tried everything to fix it, any help is greatly appreciated!

local newRay = Ray.new(Camera.CFrame.p,(Mouse.Hit.p - Camera.CFrame.p) * 1000)
local part,endpoint = game.Workspace:FindPartOnRay(newRay)
0
You do realize that FindPartOnRay returns the first part the ray hit right? SynthetickDev 188 — 6y
0
*hits SynthetickDev 188 — 6y
0
If your question was solved, please mark the correct answer as such. GlitchMasta47 7 — 6y

1 answer

Log in to vote
5
Answered by
Avigant 2374 Moderation Voter Community Moderator
6 years ago

Yes, the intersection test will end after the first intersection point is reached. If you'd like to find parts after the part you hit, you should consider casting another ray from the position that the ray hit, and so on and so forth.

Ad

Answer this question