Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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