Setting Game-Object Active/ Inactive via Button

Simple question, trying to make a cube inactive then active in the scene via a button using UDON, however i couldn’t get it working (only at most, deactivating it). Any help would be welcome.

Much appreciated.

Simplest solution for turning an object “on/off” using it’s “isActive” parameter. Just throw into “targetToToggle” parameter in your Inspector the object you want to toggle, and you’re done. You can remove either “On Mouse Down” or “Interact” events if not needed. Enjoy!
Copy-paste code right here:

AOVW3WrbMBh9laBrK0i2LEuBXqxrV8rYOkiamxGCJH/KvLn28E+7kObJdrFH2itMzl9ZYoopzQgM58KSTXy+c853Pv3++WuB7lVaAxp8XiBbp+lHdecW6Aqq6VgVidIpIA/VSew2peAsiq3FoZIas1hYrDgHTII4IEoICWDcy9/zMqmSPEODBfqBBlgGvE88NHe3oS/6ZOmhLI/h9vqidJ9FaOIhm+YPm/Vk/XTcoCpXsOosqeY3+iuYarzGukBJVlYqM3B9gQbNH5ZVkWSzzWM0nJcV3PWHq02vd1eavEgT7fXGUJQO2Rnrk+byem/rtKoLOMugrgqVer1PtU4T8x7mo/wbZGc6ilRoQk5lwIAI+chBcNBhjIkCcBxI5TjQGtNIWS5spDTlaDlZen/ReduUcJnNkgyu3M66mP50OnM0K1Ml9zCE1E6na+DneZ6Cyna8+4wIoFxhLTjFjHCOBZMhpkEUhYQzFvm6hXfqR/6WeO6zA+K7yPlIjiDPIT/nhXv7y65goHHoQyyddXzWIBNYakMwoVYzpTgBy543Wlu9XWg8qBeBUBSkTxydvsCMMYOFsQwHPKBhoLm1zHdYuAbOQy6w2+EOsjZYxzLAgTSCaNCK0xC9orc3Hnldc48K94nO5h1C9Wbl3T3fbpfj3Im5k7QbjfuScia2kkbkMDs6Wtg7RsighqbT0u+dSstjCdjJ4M8KGPIXZ9D/ImB7A17eQ1ZNb7IPeV3CRf7wNBlU7AtFDMVcxS4om4bSRMdY+qGklGpgEX0+KFu6aj8Au4Txvh7tJVxnFRRu3u3wWz90E5MBtsRY7MBGWEZUYwh4ZIgURvO2oBeE7YJe8n+Bf3sWmrb20lOTdDkdtExq6j/FXHhQEGr8v/udWiMc45RVqcIdjUb5KJ/N3AH0VBv15GBtBsCLcDW5M1n+AQ==

PS: no clue how to make a hideable “quote” type of text for the code not to appear unless you click on that, send help.

2 Likes

You can actually drop the branch node all together and use Bool Unary Negation instead. Not really that much different in a small graph, but anything to reduce the amount of nodes in the graph does help.

2 Likes

Thank you! That’s even better!

1 Like