# Object Controller

## ServerObjectController

Object(s) inheritely are always global unless they are attached to an interior. In our case we'll just be generating some basic objects and explaining what is happening.

## Video Guide

[![Object Adding Video](https://img.youtube.com/vi/admIUGmp4-g/0.jpg)](https://www.youtube.com/watch?v=admIUGmp4-g)

## Adding a Global Object

Global Object(s) are defined as a type of object that everyone can see.

All object(s) must have a unique identifier or a `uid` just in case they need to be removed later.

```typescript
Athena.controllers.object.append({ uid: `test-object-1`, model: 'prop_ld_int_safe_01', pos });
```

## Removing a Global Object

Global Object(s) can easily be removed if you know the `uid` of that object.

```typescript
 Athena.controllers.object.remove('test-object-1')
```

## Adding a Local Object to a Player

Local Object(s) are only for a single player to see. Remember that the `uid` is something you define to remove it later.

```typescript
Athena.controllers.object.addToPlayer(player, { uid: `test-object-local-1`, model: 'prop_ld_int_safe_01', pos })
```

## Removing a Local Object from a Player

As long as you know the `uid` of the local object it can be removed.

```typescript
Athena.controllers.object.removeFromPlayer(player, 'test-object-local-1');
```


---

# 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://stuykgaming.gitbook.io/old/controllers/objectcontroller.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.
