API reference
API reference
Select your platform
No SDKs available
No versions available

SpatialAnchorSpawnerBuildingBlock Class

Extends MonoBehaviour
A utility class to manage instantiation of an OVRSpatialAnchor GameObject.
By default OVRSpatialAnchor will be spawned at user's hand's / controller's position. Disable FollowHand property to spawn the OVRSpatialAnchor at the specified position and orientation. See SpatialAnchorCoreBuildingBlock.OnAnchorCreateCompleted event to get notified when the anchor is created. See also Editor/BuildingBlocks/BlockData/SampleSpatialAnchorController in the Meta XR Core SDK for an example of how to use this class.

Properties

AnchorPrefab : GameObject
[Get][Set]
A prefab to instantiate.
Signature
GameObject AnchorPrefab
FollowHand : bool
[Get][Set]
Indicates whether the OVRSpatialAnchor source prefab you instantiate will follow the user's hand.
Signature
bool FollowHand

Methods

SpawnSpatialAnchor ( position , rotation )
Spawns a new OVRSpatialAnchor for the AnchorPrefab in the provided position and the provided orientation.
Signature
void SpawnSpatialAnchor(Vector3 position, Quaternion rotation)
Parameters
position: Vector3  Position for the new anchor.
rotation: Quaternion  Orientation of the new anchor
Returns
void