Udon Script - Object Toggle Tool
Object Toggle Tool
Toggle button script with a variety of useful options. Comes with synced and local versions.
Features
With a button press the script can.
- Toggle game objects.
- Toggle materials.
- Toggle a Mesh.
- Toggle tooltips.
- Change a material colour.
- Toggle colliders.
- Update an animator bool parameter.
- Play a sound.
- Change UI text colour. (normal and TMP)
- Change UI image colour.
- Change UI toggle is on check.
Notes
This script requires RiskyKen - Core.
This script requires UdonSharp.
Install Methods
Method A: Creator Companion
- Install RiskyKen - Core (Creator Companion Version)
- Add the package to the Creator Companion. Guide
- Select your world and add the package.
Method B: Traditional Package
- Install UdonSharp
- Install RiskyKen - Core
- In the Unity editor click Assets > Import Package > Custom Package. Guide
- Now browse to the location of the package and select it.
Usage
- Select the object you want to use.
- Press add component.
- Search for object toggle tool.
- Add the version you need, synced or local.
Please remember the object will need a collider to work as a button.
The script can also be used on UI button by calling the scripts interact event from the button.
If override options are not set the script will use components on the local object.
Credits
Click Sound - https://freesound.org/people/Sheyvan/sounds/494493/
Change Log
v1.3.1
- Added collider toggle option.
- Fixed issues with checkboxes in inspector.
v1.3.0
- Added toggle sound option.
- Added synced version.
- Updated for VRChat Creator Companion.
- Added VRChat Creator Companion package.
v1.2.0
- Fixed objects being toggled on script start for toggle mode.
- Objects will now be set to the opposite state on script start in enable and disable mode.
- Objects will now be set to the buttons state on script start in match mode.
v1.1.0
- Initial release.