0
\$\begingroup\$

I have the following example:

enter image description here

How can I prevent the part of the sprite that is highlighted in red and is behind the UI from being displayed on the camera, but having the background image still showing?

\$\endgroup\$
1
\$\begingroup\$

Your Question is NOT clear ..but We can do following ways to hide the GAMEOBJECT..

1.If you use the gameobject -> sprite renderer -> order in layer (set order in layer into 0 or -1)

2.If you use the Canvas Concept Change the gameobject Z position or do game object like,

 public gameobject hideobj;
  hideobj.setActive(false);

whenever you want that game object again you can true the gameobject hideobj.setActive(true);

3.Disable the Gameobject component

 Gameobject("hideobj").getComponent<Image>.enabled=false;
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.