ReferenceScripting APIStagecastRay
Stage.castRay
methodThe first mote's body a ray from one point to another meets, next turn.
Syntax
castRay( from: Place, to: Place, options?: { world?: "2d" | "3d" }): Promise<MotionRayHit | null>Parameters
| Name | Type | Description |
|---|---|---|
from | Place | Where it starts |
to | Place | Where it ends |
options | { world?: "2d" | "3d" } | Optional. World: "2d" or "3d" (the 2D world's unless there's only a 3D one) |
Returns
Promise<MotionRayHit | null>: a promise of what it met, or null.
See also
Notes from the community
Written by creators and checked by the docs' editors. Not part of Motion's official reference.