2024-08-12 07:45:54 +08:00
|
|
|
---
|
|
|
|
sidebar_position: 3
|
|
|
|
---
|
|
|
|
|
|
|
|
# Simple Object Toggle
|
2022-11-28 11:07:30 +08:00
|
|
|
|
2024-08-11 11:04:29 +08:00
|
|
|
In this tutorial, we'll see how to create a simple menu item to toggle an object using the Reactive Object system of
|
|
|
|
Modular Avatar.
|
2022-11-28 11:07:30 +08:00
|
|
|
|
2024-08-11 11:04:29 +08:00
|
|
|
We'll try toggling on and off Anon-chan's hoodie.
|
2022-11-28 11:07:30 +08:00
|
|
|
|
2024-08-11 11:04:29 +08:00
|
|
|

|
2022-11-28 11:07:30 +08:00
|
|
|
|
2024-08-11 11:04:29 +08:00
|
|
|
First, right click on your avatar, and select `Modular Avatar -> Create Toggle`.
|
2022-11-28 11:07:30 +08:00
|
|
|
|
2024-08-11 11:04:29 +08:00
|
|
|

|
2022-11-28 11:07:30 +08:00
|
|
|
|
2024-08-11 11:04:29 +08:00
|
|
|
When you do, a new GameObject will be created as a child of your avatar, with a `Menu Item`, `Menu Installer`, and an
|
|
|
|
`Object Toggle` component.
|
2022-11-28 11:07:30 +08:00
|
|
|
|
2024-08-11 11:04:29 +08:00
|
|
|

|
2022-11-28 11:07:30 +08:00
|
|
|
|
2024-08-11 11:04:29 +08:00
|
|
|
On the `Object Toggle`, click the `+` button to add a new entry. Drag the object you want to toggle onto the empty
|
|
|
|
field. Since we want this menu item to turn the hoodie off, we'll leave the checkbox empty.
|
2022-11-28 11:07:30 +08:00
|
|
|
|
2024-08-11 11:04:29 +08:00
|
|
|

|
2022-11-28 11:07:30 +08:00
|
|
|
|
2024-08-11 11:04:29 +08:00
|
|
|
At this point your toggle is fully configured. If you want to see it in action, click the `Default` box on the Menu
|
|
|
|
Item,
|
|
|
|
and you should see the hoodie disappear.
|
2022-11-28 11:07:30 +08:00
|
|
|
|
2024-08-11 11:04:29 +08:00
|
|
|

|