# Duration (parameter)

**Duration** is an option available for almost all conditions, allowing to set a "wait time" until the corresponding condition becomes valid (instead of becoming valid instantly).&#x20;

{% embed url="<https://youtu.be/0xPFjjTUCjA?si=DoeGxgXXaRKM74e3>" %}

If you set up a `minimum duration required` it means that the given condition needs to remain true for this amount of time in order for the condition to be considered valid.

Example: the user needs to look at an object for at least 2 seconds in order for a door to open.

{% hint style="info" %}
*If you have multiple objects in your condition, then the duration time is required for each one of them in order to validate the condition.*
{% endhint %}

**If condition turns false:** here you decide what happens if during the duration time the condition turns false.

* **Reset count:** the count is reset to 0.
* **Keep Progress:** The amount of time the condition remained valid is kept in memory and if condition is true again then it accumulates until it reaches the duration time.
* **Decrease progressively:** the count decreases progressively with a speed factor.

These options are useful for game mechanics where you want the user to fulfill something for at least a given amount of time to progress/win. If the user does not, then you decide if the progress is kept in memory or not.


---

# 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://unity.zoeimmersive.com/adding-interactivity/interactions/conditions/duration-parameter.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.
