Shape:getCollider

Edit

Returns the Collider the Shape is attached to.

This function will return nil if the Shape is not attached to a Collider. When a Shape isn't attached to a Collider, the Shape can still be used for queries with World:overlapShape and World:shapecast.

collider = Shape:getCollider()

Arguments

None

Returns

NameTypeDescription
colliderCollider The Collider the Shape is attached to, or nil if the Shape isn't attached to a Collider.

Notes

A Shape can only be attached to one Collider at a time.

See also