Forum rules - please read before posting.

Object visibility

Good day. Object visibility after build doesn't work. I do in two ways:
1. Add "Invisible" script to the object. In the code, select Object -> Visibility -> Visible
2. Turn off the object. In the code, select Object -> Call Event -> GameObject. SetActive = true
Both options work fine in the editor, but don't work after build. Objects aren't included. What could be the problem?

Comments

  • You'll have to be more specific - there is no "Invisible" script in AC's core. Is this a custom script?

    What do you mean exactly by "object's aren't included"? Please share your AC/Untiy version numbers, and the platform you're building to.

    I'm assuming that your scenario involves an object the starts off invisible, and is later made visible. Is this object present in the scene, or are you referring to a prefab? What type of Renderer component does it have? (SpriteRenderer, MeshRenderer, etc).

    If you use the Object: Visibility" Action, you'll need to attach the **Remember Visibility Action so that you can save its state, as well as set its initial visibility state to "Invisible". You generally shouldn't disable GameObjects completely, as it'll break references to them.

    Another method would be to animate the enabled state of the object's Renderer component with an Animator component, set up transitions, and then control the animation playback with the Object: Animate Action. Your method #1 should work, however, so please share screenshots and details so that I can see better exactly what's going on.

  • Script "invisible" is in AC: http://prntscr.com/nc3q02

    I figured out why invisibility didn't work in the build.

    "You generally shouldn't disable GameObjects completely, as it'll break references to them."

    How then is it better to turn off objects? For example, if a Hotspot is present on an object, then disabling the Sprite Renderer will not turn off the hotspot, and sometimes I need to completely turn off the object. How to be then?

  • You can use the Hotspot: Enable or disable Action to turn a Hotspot off. Attaching the Remember Hotspot component to it will save its on/off state.

  • Thank you. Found it

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.