# ARGeospatialAnchor

The `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARGeospatialAnchor#classGoogle_1_1XR_1_1ARCoreExtensions_1_1ARGeospatialAnchor` is an ARCore Extensions object that provides a similar service to AR Foundation's `ARAnchor` as an anchor for game objects in your scene.

It is created at the specified geodetic location and orientation relative to the Earth.

## Summary

### Inheritance

Inherits from: [`UnityEngine::MonoBehaviour`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.html), [`UnityEngine::XR::ARSubsystems::ITrackable`](https://docs.unity3d.com/Packages/com.unity.xr.arsubsystems@4.2/api/UnityEngine.XR.ARSubsystems.ITrackable.html)

| ### Properties ||
|---|---|
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARGeospatialAnchor#nativeptr` | `https://docs.microsoft.com/en-us/dotnet/api/System.IntPtr` Gets the native pointer that represents this Geospatial Anchor. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARGeospatialAnchor#pose` | `https://docs.unity3d.com/ScriptReference/Pose.html` Gets the `Pose` associated with this Geospatial Anchor. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARGeospatialAnchor#terrainanchorstate` | `https://developers.google.com/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#terrainanchorstate` **[Deprecated.](https://developers.google.com/ar/reference/unity-arf/deprecated/deprecated)** When resolving a Terrain anchor using an async method, get the result status from the Promise object. Gets the `TerrainAnchorState` associated with this Terrain anchor. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARGeospatialAnchor#trackableid` | `https://docs.unity3d.com/Packages/com.unity.xr.arsubsystems@4.2/api/UnityEngine.XR.ARSubsystems.TrackableId.html` Gets the `TrackableId` associated with this Geospatial Anchor. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARGeospatialAnchor#trackingstate` | `https://docs.unity3d.com/Packages/com.unity.xr.arsubsystems@4.2/api/UnityEngine.XR.ARSubsystems.TrackingState.html` Gets the `TrackingState` associated with this Geospatial Anchor. |

| ### Public functions ||
|---|---|
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARGeospatialAnchor#ondestroy()` | `void` When the game object containing the `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARGeospatialAnchor#classGoogle_1_1XR_1_1ARCoreExtensions_1_1ARGeospatialAnchor` component is destroyed, the underlying native object will be detached and the resource will be released. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARGeospatialAnchor#update()` | `void` Unity's Update method. |

## Properties

### nativePtr

```c#
IntPtr nativePtr
```
Gets the native pointer that represents this Geospatial Anchor.

### pose

```c#
Pose pose
```
Gets the `Pose` associated with this Geospatial Anchor.

### terrainAnchorState

```c#
TerrainAnchorState terrainAnchorState
```
Gets the `TerrainAnchorState` associated with this Terrain anchor.

**[Deprecated.](https://developers.google.com/ar/reference/unity-arf/deprecated/deprecated)**When resolving a Terrain anchor using an async method, get the result status from the Promise object.

### trackableId

```c#
TrackableId trackableId
```
Gets the `TrackableId` associated with this Geospatial Anchor.

### trackingState

```c#
TrackingState trackingState
```
Gets the `TrackingState` associated with this Geospatial Anchor.

## Public functions

### OnDestroy

```c#
void OnDestroy()
```
When the game object containing the `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARGeospatialAnchor#classGoogle_1_1XR_1_1ARCoreExtensions_1_1ARGeospatialAnchor` component is destroyed, the underlying native object will be detached and the resource will be released.

### Update

```c#
void Update()
```
Unity's Update method.