Scripts: Display of objects and texts

Hi there,

does anyone know which is the correct scripting to display an object or text?

Thanks
Eva

Hi Eva,

You can use the visible(…) setter to change the visibility of nodes.

For example, if you wanted to change a Plane to not be visible when a button is tapped -

Button.on("pointerdown", (e) => {
      Plane.visible(false);
});

Alternatively, you can set up the visibility property to be altered by a states - https://docs.zap.works/studio/getting-started/controllers-and-states/ and activated using actions - https://docs.zap.works/studio/getting-started/buttons-and-interactivity/.

Hope this helps.

George