PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

FindPartOnRayWithIgnoreList

This function is a variant of WorldRoot/FindPartOnRay with the addition of an ignore list. This lets you ignore certain parts or Model|Models.

Those looking to utilize a whitelist instead should use WorldRoot/FindPartOnRayWithWhitelist.

Notes

  • Theoretically, a ray extends infinitely in one direction. However, the max length of the direction vector on Roblox is 5000 studs.
  • The length (magnitude) of the directional vector is important, as parts further away than its length will not be tested.
  • If the ray does not intersect anything, the return values will be nil and the point at the end of the ray, respectively.
  • Parts that are in a articles/Collision Filtering|collision group that does not collide with the “Default” collision group are ignored implicitly.

Parameters

Name Type Default Description

ray

Ray
false
false

Returns

Return Type Summary

The BasePart or Terrain cell hit, the DataType/Vector3 point of intersection, the DataType/Vector3 surface normal at the point of intersection, and the Enum/Material of the BasePart or terrain cell hit.