Home > Net >  Order in Layer not working - Unity Hub 2021
Order in Layer not working - Unity Hub 2021

Time:07-26

I have been trying for some hours and almost finished reading all answers on Unity as well as on Stackoverflow. I still don't know how I can place that Pink Character shown in attached picture on to front of the Background. Can anyone please help me?

Image

CodePudding user response:

There are many ways to go about this, you just need to test out what works for you and be creative. There are a few things that you can do:

Option - A

You can try to change Samus's Transform to a rect transform then set the z-index.

Option - B

Change the canvas render mode or sort order

Option - C

Add Samus to the canvas as an Image, then put the image above the background by moving it in the Hierarchy.

Option - D

as suggested by @pixlhero, simply make the background image a SpriteRenderer as well then move it behind Samus in the Hierarchy.

CodePudding user response:

Thanks everyone for your help.

Here is how I solved the problem without Code


Solution:


Step 1: Go to Hierarchy -> Create Empty GameObject.

Step 2: Click on Add Component to add a Sprite Renderer to your Empty GameObject.

Step 3: I imported my character by dragging it into Unity Project Asset Folder.

Step 4: Add the character into Hierarchy and then add Sprite Renderer Component to your Character.

Thanks,

  • Related