# trackScreenSpacePosition

> Whether the root visual element follows the position of the GameObject in screen space. The default value is false.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine.UIElements](/engine/6000.7/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
public bool trackScreenSpacePosition { get; set; }
```

### Remarks

Only takes effect in screen-space render modes. Ignored in [PanelRenderMode.WorldSpace](/engine/6000.7/script-reference/unityengine/uielements/panelrendermode/worldspace.md).

While enabled, the root visual element is sized by its content and the renderer controls its `translate` and `display` inline styles: every frame, the root is translated so its origin matches the position of the GameObject on screen, as seen from the main camera. When that position is not on screen, the root is hidden. When there is no main camera, the last tracked styles are kept.

Use this, for example, for a screen-space health bar that follows a unit moving in the 3D world. Use [\_screenSpaceOffset](/engine/6000.7/script-reference/unityengine/uielements/panelrenderer/screenspaceoffset.md) to offset the UI from the tracked position.
