Forum rules - please read before posting.

Enable/ Disable a gameobject in a scene with an action

edited October 2021 in Technical Q&A

I know I can affect an object's visibility, teleport and instantiate from a prefab. But is there a way to enable or disable a gameobject that is in the scene with an action in an actionlist? Would be useful to me if it doesn't wreck havoc with the save system.

UPDATE-- found other posts that explain the reason for the absence of this functionality. Thanks.

Comments

  • Is the object: call event - set active action dangerous to use and not recommended or has the newest version of unity and AC made this acceptable?

  • In general I recommend caution when enabling/disabling GameObjects, but that's not a version issue. A disabled object will be invisible to AC so far as operations such the save system go.

    If the object itself isn't AC-related you should be able to use this Action to affect it, but it really does depend on the situation.

    What is the scenario?

  • One scenario is an object (a portal) that is a particle effect with a hotspot, actionlist, etc parented to the particle effect. I was looking to activate and deactivate it under various circumstances. Currently I am teleporting it from off screen. I suppose I could turn it into a prefab with parameters but sometimes I’m lazy.

  • You should be able to manually activate/deactivate it so long as you did away with any Remember components for it and updated its state manually in an OnLoad cutscene.

    Aside from teleporting / spawning it, though, another possible option would be to place it in a scene of its own and add/remove the scene using the Scene: Add or remove Action.

  • edited November 2022

    .

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.