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?


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;

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

3.Disable the Gameobject component


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.