Instance Method

clone(recursive:)

Duplicates a trigger volume to create a new trigger volume.

Declaration

func clone(recursive: Bool) -> Self

Parameters

recursive

A Boolean that you set to true to recursively copy all the children of the entity. Otherwise, no descendants are copied.

Return Value

A new TriggerVolume instance that is a duplicate of the original.

Discussion

This method clones all component data automatically. When you clone an entity that stores custom data that’s not part of a component, override the didClone(from:) method to copy that data manually after the clone finishes.

See Also

Creating a Trigger Volume

init()

Creates a trigger volume.

init(shape: ShapeResource, filter: CollisionFilter)

Creates a trigger volume with the given shape and collision filter.

init(shapes: [ShapeResource], filter: CollisionFilter)

Creates a trigger volume with the given composite shape and collision filter.