> For the complete documentation index, see [llms.txt](https://docs.artar.es/project-creation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.artar.es/project-creation/menu-animation.md).

# Menu animation

The object type "Button" has a setting "Menu item".

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

There is a hidden variable in the open project — the menu item number. By default the scene's start state is zero. And it returns to it on a repeated click.\
\
When you press a button with a menu item, the number changes to that item. If you click again, it will reset to zero. If the item is zero, it will also reset.\
\
The animation will trigger when the number has changed.\
\
To do this, select the object you want to animate, configure the animation values and in "Start events" choose menu. An additional setting will open — "On transition." Specify the number (or "any") next to "from" and "to."

Clicking on "from" or "to" will change the digit to the value "any." This means that whatever state the scene is in, clicking the button will initiate switching the scene to the specified state.&#x20;

Also the algorithm will trigger several animations if, for example, the scene transitions from item 2 to item 3. The following will fire:\
\[2 "any"] \["any" 3] \[2 3].

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

For clarity and a better understanding of the menu animation logic, a hint is implemented in the preview (without AR and when scanning the QR code in the editor). A number will appear in the upper right corner showing the current state of the scene. &#x20;

You don't need to hide this number in any way, just download the QR code and the hint numbers will not appear when viewing the scene.&#x20;

This QR code feature is described in this section.

<figure><img src="/files/374fa111a7d3ec5c75a1ff2469445b99b6b6be9b" alt=""><figcaption></figcaption></figure>

Setting the scene's start state allows more flexible configuration of the menu animation.

So a repeated click will still return the scene to the zero state, but not to the start state. There will be a separation between the start state and the state that triggers the animation on a repeated click.&#x20;

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

For example, use this setting if you need to show an object on the first opening of the project (set the first-appear animation for this), and on the first click initiate a double animation — hide the first object and show the second.

<figure><img src="/files/0e55d87ab81092a935925a7c85b720c81203ae13" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.artar.es/project-creation/menu-animation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
