teleportCharacter(to:relativeTo:)
Moves the character instantly to a new position.
Declaration
@MainActor @preconcurrency func teleportCharacter(to position: SIMD3<Float>, relativeTo referenceEntity: Entity?)Parameters
- position:
The position to move the character to, relative to
referenceEntity. - referenceEntity:
The entity that defines a frame of reference. Set this to
nilto indicate world space.
Discussion
This method moves the character to a location specified relative to another entity. Pass nil in relativeTo to specify a position in world coordinates. A teleport move happens instantly. RealityKit does no collision checking when it moves the entity.