sm.physics.capsulecast

Performs a capsule ray cast (Z-axis aligned) between two positions.

Kind: Function

Environments: Game

Game

sm.physics.capsulecast(
    start,
    end,
    radius,
    height,
    ignore,
    mask,
    world,
    ignoreUuids
)

Open the full Game reference

The returned RaycastResult contains information about any object intersected by the ray.

If the ray cast is called from within a shape (e.g. a Sensor), a Body may be provided which the ray will not intersect.

Parameters:

Name Type Description
start Vec3 The start position.
end Vec3 The end position.
radius number The radius of the capsule.
height number The height of the cylindrical part of the capsule.
ignore (optional) Body|Shape|Harvestable|Character|AreaTrigger An object to be ignored. (Optional)
mask (optional) integer The collision mask. Defaults to sm.physics.filter.default (Optional)
world (optional) World The world to perform the cast in. (Optional)
ignoreUuids (optional) table A table of uuids {Uuid, ...} of Shape, Harvestable or Character type to be ignored. (Optional)

Returns:

Type Description
boolean True if raycast was successful
RaycastResult The raycast result data.