# AttachToCamera

### Introduction

The AttachToCamera property controls whether an object is attached to the Camera. HUD and UI elements are often attached to the Camera so that they stay in the same screen position when the Camera moves.

### Usage

To attach an instance of an object to the Camera:

1. Select the instance under the "Object" tree item in a given Screen
2. Set the AttachToCamera property to true:

<figure><img src="/files/aac41THLTdzs05KstRUI" alt=""><figcaption></figcaption></figure>

### AttachToCamera only available in Screens

The AttachToCamera property is only available on objects which are contained in Screens. Objects which are contained in Entities do not have this property, and functionally AttachToCamera will always be false on objects in Entities. The reason for this is because even though this is something which is supported by the underlying FlatRedBall engine, it can result in confusing and difficult-to-debug behavior. Keeping all attachments to Camera at the Screen level makes it much easier to identify why an object is not behaving as you might expect.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flatredball.com/flatredball/glue-reference/objects/glue-reference-attachtocamera.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
