# Troubleshooting

### Detection area mispositionned (v1)

Two cases:\
\
1- The misalignment of the detection area is likely due to a Prefab issue.&#x20;

If your door is a Prefab, which is typically the case for consistency, you'll need to click on "Calculate Detection Area" once it's instantiated in your scene. \
Since the detection area is based on world position, it won't move with your door when it opens or closes.&#x20;

Therefore, if you position the detection area within the Prefab space, it may not align properly with the world position in your scene.

2- A mispositioned detection area can also be caused when **the parent** (containing the SmartDoor component) and **the child** (the actual door) do not have their forward directions aligned. \
Make sure to **rotate them** so they **face the same direction**, reset the open/close position, and then recalculate the detection area.

### Door is not opening ?!

Most of the time, doors that don't open are due to misconfigurations:

1. Ensure that the SmartDoor component is added to an empty parent GameObject. \
   [Learn more](/door-system-documentation/general/getting-started/create-simple-door.md#prepare-your-gameobject).
2. Make sure your doors and their children are dynamic GameObjects and not static. Uncheck the static option if necessary. \
   [Learn more](https://docs.unity3d.com/Manual/StaticObjects.html).
3. Check the **Layer Mask** and **Tag Mask** settings for your Detection Area.
4. Verify that your Player is assigned to the **correct Layer** and has the **appropriate Tag**.
5. Align the forward direction of the SmartDoor GameObject [as described here](/door-system-documentation/general/getting-started/create-simple-door.md#configure-your-smartdoor).

### Door is deformed when opening (v2)

Check the Scale of the GameObject containing SmartDoor component. \
This scale must be uniform (1,1,1 or 2,2,2 or 3,3,3, etc...).

If you need a non uniform scale, just apply it on the child instead.

### Doors don't work since v2

If you previously had Door System v1, you need to perform some operations to deal with the breaking changes.

Fortunatly, Door System v2 is shipped with a powerful Migration Tool. \
You can learn [how to use it right here](/door-system-documentation/advanced/migration-tool.md).


---

# 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.cgpoly.io/door-system-documentation/general/troubleshooting.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.
