Skip to main content

RayCastOptions

Index

Properties

optionalcollisionGroup

collisionGroup?: CollisionGroup

Optionally specify a collision group to target in the ray cast, default is All.

optionalcollisionMask

collisionMask?: number

Optionally specify a collision mask to target multiple collision categories

optionalfilter

filter?: (hit: RayCastHit) => boolean

Optionally provide a any filter function to filter on arbitrary qualities of a ray cast hit

Filters run after any collision mask/collision group filtering, it is the last decision

Returning true means you want to include the collider in your results, false means exclude it


Type declaration

    • Optionally provide a any filter function to filter on arbitrary qualities of a ray cast hit

      Filters run after any collision mask/collision group filtering, it is the last decision

      Returning true means you want to include the collider in your results, false means exclude it


      Parameters

      Returns boolean

optionalignoreCollisionGroupAll

ignoreCollisionGroupAll?: boolean

Optionally ignore things with CollisionGroup.All and only test against things with an explicit group

Default false

optionalmaxDistance

maxDistance?: number

Optionally specify the maximum distance in pixels to ray cast, default is Infinity

optionalsearchAllColliders

searchAllColliders?: boolean

Optionally specify to search for all colliders that intersect the ray cast, not just the first which is the default