# Prefab main actor

In Hology Engine, a **Main Actor** allows you to define the primary identity of a prefab. By designating a specific actor within a prefab as the "Main Actor", the prefab itself effectively adopts that actor's type.

This concept creates an "is-a" relationship between the prefab and its main actor. For instance, a complex `SciFiSlidingDoor` prefab containing meshes, sounds, and particle effects can be designated to *be* a `DoorActor`.

### Why use a Main Actor?

Setting a main actor provides two major benefits for gameplay engineering and level design:

#### 1. Referencing in the Editor

When a prefab has a main actor, instances of that prefab can be assigned to component parameters that expect the main actor's type.

**Example:** Imagine you have a `PressurePlate` actor in your scene that has a property `target` of type `DoorActor`.

* **Without Main Actor**: You cannot reference the `SciFiSlidingDoor` prefab instance in the `target` parameter because the engine sees it merely as a generic prefab or group.
* **With Main Actor**: If the `SciFiSlidingDoor` prefab has its internal `DoorActor` actor set as the Main Actor, you can reference the `SciFiSlidingDoor` instance directly into the `PressurePlate`'s `target` parameter. The engine resolves this reference to the internal `DoorActor` actor automatically.

#### 2. Parameter Overrides

Parameters on the Main Actor become exposed on the prefab instance in the scene editor.

This allows level designers to tweak gameplay values (like `OpenSpeed` or `Locked`) directly on the prefab instance without needing to dig into the prefab hierarchy to find the specific logic actor.

### How to set a Main Actor

1. Open the prefab you want to edit.
2. In the **Outliner**, find the actor that represents the core logic or identity of the prefab.
3. Right-click the actor and select **Set as Main Actor**.

#### Unsetting

To remove the association, right-click the current Main Actor in the Outliner and select **Unset Main Actor**.


---

# 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.hology.app/gameplay/actors/prefab-main-actor.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.
