– Ray casting on the Z
– Ray casting on the X
I understand that I have been ray casting only changing the X offset which is why, but I wanted a more consistent way than also ray casting on the Z (meaning I am changing x,y,z of a vector3), since it isn’t the pattern I’m trying to achieve and also a 3 way nested loop is WAY too many rays to be casting.
Looking for possible solutions. Currently I have this:
local ray = Camera:ScreenPointToRay(x,y)
for y2 = 30, -30, -5 do
for x2 = -30, 30, 5 do
if Mouse.Hit then
Scan(ray.Origin,ray.Direction * MaxDist + Vector3.new(x2,y2,0),Color3.fromRGB(255,255,255))
end
end
task.wait()
end
Thanks in advance.