Hi! Just a quick question.
while true do
wait(1)
local part, position = Ray.new(Vector3.new(0,0,0), Vector3.new(0,50.0)
print(part, position)
end
Just wondering what part and position return. Thanks! ![]()
Hi! Just a quick question.
while true do
wait(1)
local part, position = Ray.new(Vector3.new(0,0,0), Vector3.new(0,50.0)
print(part, position)
end
Just wondering what part and position return. Thanks! ![]()
Ray.new doesnt return a part or position, it returns a ray in which you can use to get the part, position, and surface normal from workspace:FindPartOnRay(ray).
If you look at the jeep found in the suburban map, and if you go to the script called ‘CarScript’ (parented to the jeep) and on line 22, the line is able to return hit and position without calling :FindPartOnRay()…
That’s because its using a module to make it easier to raycast, just like having a raycast function. “Raycast Module”
Oh, did not see that lol. Thanks! ![]()
Hi, HiddenKaiser. I found out about this new function called “Raycast” and I was wondering if it functions the same as Ray.new. May you help figure it out for me?
WorldRoot - Roblox API Reference – best Ro-API reference.
Hey nulllifeleft,
That looks like an incredibly old version of Ray.new(), but yes, it’s the same premise.
Raycast isn’t new and it isn’t comparable to Ray either. Rays are datatypes and Raycast is a method that’s intended to perform the actual cast. Its purpose is to condense all ray functions into one with parameters to adjust the behaviour of the cast.
Ray.new =/= WorldRoot.Raycast