Skip to main content

raycastPoints

Casts rays from two positions in the world and returns hit information.

Syntax​

engine.world.raycaster.raycastPoints(from, to, options);

Parameters​

NameTypeDescription
fromVector3 or Vector3ArrayThe starting position of the ray in world coordinates.
toVector3 or Vector3ArrayThe ending position of the ray in world coordinates.
options (optional)RaycastOptionsAdditional options for the raycast.

Returns​

Example​

const intersects = engine.world.raycaster.raycastPoints(
[5, 1, 10], // from - where to start the ray
[10, 1, 20], // to - where to end the ray
);

console.log('what did we hit?', intersects);

Available on: Client