createAnchor

suspend fun createAnchor(position: Vector3, rotation: EulerAngles, name: String = ""): WorldTrackingResult<WorldAnchor>

Asynchronously creates a new anchor with a specified position, rotation, and name.

This method enables you to create a new anchor in the 3D space defined by the current Stage. This suspend function completes when the native provider callback reports success or failure.

Return

The result containing the created WorldAnchor.

Parameters

position

The position of the anchor in the current Stage coordinate space, in meters.

rotation

The rotation of the anchor in the current Stage coordinate space, as Euler angles in degrees.

name

(Optional) The name of the anchor, which defaults to an empty string.