Forum rules - please read before posting.

Suggestion: GameObject Activation / Deactivation Action

I searched and saw a few threads about functionality like this from a few years ago, but am not sure if it was ever really solved beyond the use of additional scripts.

I think it would be great if there was an Object > Activate/Deactivate action that would do simply that: Activate and deactivate GameObjects in a scene.

In addition to being really handy, I think it would prevent new users from getting confused about Object > Visibility, or even Object > Send Message > Turn On/Off, both of which I remember assuming had to do with activating and de-activating GameObjects and being very confused as to why they didn't work. :)

Not something I can't live without, but a gap that I think deserves to be filled...!

Comments

  • The issue is that Unity can fail to "see" the object once deactivated.  This brings up additional problems with saving, working via ActionList assets, and so on.

    Such an Action could be written "unofficially" and may work for some cases, but it's too problematic to be provided as part of AC itself.
  • Can't see it?! That's bizarre.

    Anyways, thanks for the response - I've made my way around it!
  • Yeah, I've been working with that too. It's relatively easy for unity to find disabled objects when searching in editor. But it gets far trickier in build/play, since the finders you use for cycling through all objects come from UnityEditor libraries. If you want to cycle through things in builds, you'll have to have a root gameObject that houses the things that you wish to search through and some global link to it, then you can cycle through children. But that's some additional restrictive scene setup. 

    But in case you found a more simple solution for builds, I'd love to hear it!
  • I utilized the solution that Chris offered up in another thread, which is to add a 'Remember Transform' component to the object, ensure that 'Save Scene Presence' is checked, and then save the object as a prefab under Resources. That doesn't allow for 'activation', per se, but it does all you to use the Object > Add action to make something pop into the scene...!

    Give it a shot!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.