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

Is Origin and Direction not a property of workspace:RayCast?

Asked by 4 years ago
Edited 4 years ago

when I try to print out the Origin and Direction of the ray it errors out saying:

 18:41:00.464  'Origin' is not a valid member of RaycastResult  -  Server  -  Script:4
  • Script:
wait(3)
local rayResult = workspace:Raycast(Vector3.new(0,1,0), Vector3.new(0,0,100))
if rayResult then
    print(rayResult.Origin)
    print(rayResult.Direction)
end


1 answer

Log in to vote
1
Answered by
Luathron 185
4 years ago
Edited 4 years ago

workspace:Raycast returns a RaycastResult value. You can find the properties of RaycastResult at developer.roblox.com/en-us/api-reference/datatype/RaycastResult

0
It says that origin is a peppery of ray cast but how do I access that. Do I have to make origin a variable before I put it in the ray cast, but it says that origin is a property so I should just be able to access it xXmacerofXx 29 — 4y
0
didn't understand that parameters are values you pass on and cannot be retrieved xXmacerofXx 29 — 4y
Ad

Answer this question