WorldAnchorManager.AttachAnchor(GameObject, String) Method

Definition

Attaches an anchor to the GameObject. If the anchor store has an anchor with the specified name it will load the anchor, otherwise a new anchor will be saved under the specified name. If no anchor name is provided, the name of the anchor will be the same as the GameObject.

public string AttachAnchor (UnityEngine.GameObject gameObjectToAnchor, string anchorName = default);
member this.AttachAnchor : UnityEngine.GameObject * string -> string
Public Function AttachAnchor (gameObjectToAnchor As GameObject, Optional anchorName As String = Nothing) As String

Parameters

gameObjectToAnchor
UnityEngine.GameObject

The GameObject to attach the anchor to.

anchorName
String

Name of the anchor. If none provided, the name of the GameObject will be used.

Returns

String

The name of the newly attached anchor.

Applies to