Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

2 comments

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

0

didn't understand that parameters are values you pass on and cannot be retrieved

This discussion is preserved as it was. New answers, comments, and votes are closed.