CastRayOptions
What castRay and castRayAll take: the ray, from a point along a
direction for so many metres, and the filter.
Extends
Section titled “Extends”Extended by
Section titled “Extended by”Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
asEntity? |
Entity | Instigator | null |
The entity the query is asked for, such as the shooter or the character whose camera it places: it meets what that entity meets, so a passer-by’s ray passes a court’s membersOnly net, which a member’s meets. An instigator is judged by the match it acted in, so a shot fired on a court is judged by that court wherever its shooter has gone. null asks room-wide and meets every body. Left out, it meets every body too, and a development world warns once per system where it meets a membersOnly one. As Unity’s Rigidbody.SweepTest queries as a body, and Roblox’s RaycastParams.CollisionGroup makes a ray stand in a group. |
bodyTypes? |
readonly RigidBodyType[] |
The kinds of body the query meets, every kind where left out: by the kind each body declares, so a page’s stand-in for a ball the room rolls counts as dynamic. A character’s capsule is kinematic. |
collisionLayer? |
CollisionLayerHandle |
The layer the query stands in, as a body standing there would: it meets only colliders whose own mask holds it, so a monster’s floor ray passes through what monsters pass through. Left out, it stands in every layer, and meets every collider whose mask holds any: one whose mask is empty meets nothing, a query included. |
collisionMask? |
CollisionMask |
The layers whose colliders the query meets: every layer where left out. |
direction |
Vector3Like |
Which way it goes, in world space: any length but zero, since the query normalizes it. |
from |
Vector3Like |
Where the ray starts, in world space. A collider it starts inside is met at distance 0. |
ignore? |
readonly Entity[] |
Entities whose colliders the query passes through, such as the caster’s own; one destroyed since is passed silently, since it has no collider left to meet. |
includeTriggers? |
boolean |
Whether the query meets trigger colliders, which it passes through by default, as Unity’s QueryTriggerInteraction does. |
maxDistance? |
number |
Metres it reaches: without end where left out. |
rewind? |
Rewind |
Meets every other entity the stream draws, with a body that moves, where the player’s screen showed it at the moment this names: a command a reader yielded, at its view step as the room held it, or { player, step }. Fixed bodies, terrain, the player’s own predicted entities, flights and entities no send carries stand where they are now; an entity the player’s screen never showed, or one that teleported or respawned since, is not met. In a world with no sends, as a game played alone, it meets the present. Left out, the query meets the present. With no asEntity, the query is asked for the command’s entity or the player’s character. |