functiongenerated
Physics.raycast
The closest 2D collider hit, as RayHit2d or null. Normalizes a nonzero Vec2 direction; returns world-space point, normal and distance. The mask selects collider memberships; include_sensors opts into triggers; exclude skips all pieces of one entity (or null). Origin, direction and distance must be finite; distance non-negative; mask a whole u32. Inside hits have distance 0 and normal Vec2(0, 0). Queries synchronized geometry; ignores inactive/despawned entities. Ties prefer entity handle then piece order.
Signature
Physics.raycast(origin: Vec2, direction: Vec2, max_distance: number, mask: number, include_sensors: bool, exclude: Entity) -> RayHit2dMember of Physics
Related types
- Source
- docs/generated/decay-api.json
- Schema
- v1
- Engine version
- 0.1.0
- Source commit
909aca81368b