Document RaycastParams, RaycastResult, and add a description to Raycast, GizmoRaycast, and IKMoveTo

The developer hub currently doesn’t document RaycastParams and RaycastResult, and provides no description for WorldRoot:Raycast, StudioService:GizmoRaycast, and WorldRoot:IKMoveTo.

Some info

RaycastParams RaycastParams.new()
Creates a RaycastParams and returns it.
All the members of RaycastParams can be read from and written to.

bool RaycastParams.IgnoreWater
Whether the raycast should ignore water

Enum.RaycastFilterType RaycastParams.FilterType
What the FilterDescendantsInstances should do

Instances RaycastParams.FilterDescendantsInstances
A sequence of instances used in raycasting, behavior determined by RaycastParams.FilterType

RaycastResult can’t be created manually, instead it’s only the return value for WorldRoot:Raycast and StudioService:GizmoRaycast

Instance RaycastResult.Instance
The instance intersected

Vector3 RaycastResult.Position
The location of the intersection

Vector3 RaycastResult.Normal
The surface normal of the face intersected

Enum.Material RaycastResult.Material
The material of the face intersected

Both WorldRoot:Raycast and StudioService:GizmoRaycast will return nil if there was no intersection.

9 Likes

Wew, more mismanagement!
There is official documentation present in Roblox’s auto-complete metadata file.

5 Likes

Hi guys, I’ve just published the RaycastParams, RaycastResult, and WorldRoot:Raycast pages. Should be visible soon now. The other two I’m waiting on engineer info. It’s taking a bit longer than expected.

2 Likes

I noticed one thing in the documentation for RaycastResult; it states that the Instance property is a BasePart, but with GizmoRaycast it can be a Constraint or Attachment. Can this be fixed?

1 Like