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

Can someone explain the logic of this ray problem?

Asked by 4 years ago

This is the popular choice of how to create a ray:

local ray = Ray.new(script.Parent.Position, (workspace.PART2.Position - script.Parent.Position).Unit*300)

And this is another way:

local ray = Ray.new(script.Parent.Position, (workspace.PART2.Position).Unit*300)

Could someone explain to me why the first one works while the second one does not? I really do not see why subtracting the origin position helps.

0
The direction argument in Ray() is not a Position Vector3, it is an angular Vector 3. That discribes in witch angle the ray will be casted, and not the position the ray will be faced to. Necro_las 412 — 4y

Answer this question