# Mirror Toggle

* Add a VRC Mirror prefab, disable it to save performance by default
* Add a `Universal Action` to the Mirror object
* Make sure `Active` is checked, check `Fire Object Toggles`, click on the `Game Objects List` and click `Add Element`
* Drag your Mirror object into the empty field, select `Toggle` in the dropdown on the right

![](https://1714596913-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQWbrSe37gNXUDtQ8DJ%2F-MVMVSmF-qLVfirkOD1A%2F-MVMVuIuKJKGPNFStSeL%2Fimage.png?alt=media\&token=3d793deb-271a-4246-b190-2314f03e99d8)

* Add a `UI -> Button` to your scene, set the `Render Mode` to `World Space` and scale it way down and place it where you want
* Add a `Ui Shape` component to the Canvas
* Change canvas layer to `Default`
* Click on your Button inside the Canvas and add a new `On Click()` event by clicking the small `+` icon in the bottom right
* Drag and Drop your Mirror object into the empty field that appeared
* In the dropdown next to `Runtime Only` select `UdonBehaviour -> SendCustomEvent` (its all the way at the bottom)
* Type `Trigger` in the text field

![](https://1714596913-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQWbrSe37gNXUDtQ8DJ%2F-MVMVSmF-qLVfirkOD1A%2F-MVMVzTvT8rtzp3V5sav%2Fimage.png?alt=media\&token=7aa8e113-ee76-442f-8931-e033c7cb625e)

You're done! Now you can toggle your mirror via UI button in Udon.

{% hint style="warning" %}
The major thing to note here is to make sure that the component, and the game object its on, is always enabled if you're using the `Delay` parameter, otherwise it will never fire as the Update method will never be called.
{% endhint %}
