Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Rosscoe3 · Nov 25, 2015 at 05:37 AM · uiimagelayerslayering

UI Layering Problem!

High im trying to get my object "Special Glow" to render underneath the 3 "special" objects, but when i click play, it moves the Special Glow to the very front, on top of the other UI objects.alt text

alt text

screen-shot-2015-11-25-at-123633-am.png (101.8 kB)
screen-shot-2015-11-25-at-123627-am.png (70.7 kB)
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bonfire-Boy · Nov 25, 2015 at 11:13 AM 0
Share

Are you doing anything with these game objects in code?

avatar image Rosscoe3 Bonfire-Boy · Nov 25, 2015 at 09:04 PM 0
Share

yes this is the code for the objects this is on awake: specialGlow = GameObject.Find ("Special Glow"); special1 = GameObject.Find ("Special 1"); special2 = GameObject.Find ("Special 2"); special3 = GameObject.Find ("Special 3");

this is on Start: specialGlow.SetActive (false); special1.SetActive (false); special2.SetActive (false); special3.SetActive (false);

and this is a long if statement in update: if(specialNmb >= 1) { special1.SetActive (true); } else { special1.SetActive (false); }

     if(specialNmb >= 2)
     {
         special2.SetActive (true);
     }
     else
     {
         special2.SetActive (false);
     }

     if(specialNmb == 3)
     {
         special3.SetActive (true);
         StartCoroutine(Special3());
     }
     else
     {
         special3.SetActive (false);
     }

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by trollanator5729 · Mar 07, 2021 at 10:32 PM

for anyone that comes across this, use a little setting called "Sort order" inside the canvas component to set the Layering of UI elements.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bonfire-Boy · Mar 07, 2021 at 11:28 PM 0
Share

I've never used the Sort Order setting. Is this how it works, by rearranging the children in the way the OP showed?

avatar image
0

Answer by SummitJain · Nov 25, 2015 at 12:00 PM

Easy to solve issue.

The Canvas UI renders based on the child object hierarchy. Just select the object and put it outside SpecialBar gameobject and make it directly a child object as its just a background. Make sure that the image is behind the layer of the specialBar. this should immediately fix the issue.

Alternate way:

Just make sure that the SpecialBar object is the last in the heirarchy. Its calling before your menu, score and death Ui objects in Canvas.

Hope this helps. Cheers! Sumit

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bonfire-Boy · Nov 25, 2015 at 12:15 PM 1
Share

But it looks to me like the hierarchy order is set up to render the glow beneath the other objects. Can you explain why the hierarchy order is changing when they press Play?

avatar image Rosscoe3 · Nov 25, 2015 at 09:02 PM 0
Share

Yes this would work.. but the object needs to be parented to the Special Glow, because it uses animation

avatar image Rosscoe3 · Nov 25, 2015 at 09:37 PM 0
Share

@SummitJain ok im trying to do your first suggestion.. but how do i make it directly a child Object??

avatar image Bonfire-Boy Rosscoe3 · Nov 26, 2015 at 01:07 AM 0
Share

They mean a direct child of the Canvas, at the same level as Special Bar. Click on it in the hierarchy , drag it up and drop it into the Canvas just above Special Bar.

It should work. But then, as far as I can see, what You've already got should work too. I'm still puzzled as to how the order could be getting changed when you press Play, it doesn't look like you're creating new objects or changing their parenting in code, which are the only potential causes I can think of.

avatar image Rosscoe3 Bonfire-Boy · Nov 26, 2015 at 04:06 AM 0
Share

yeah :P well poo.. i will figure out something tho!!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

42 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to move UI Image under the other UI elements? 3 Answers

Canvas UI Priority layers 1 Answer

UI Enabled not working? 1 Answer

Light Raw Image in UI 0 Answers

Detect Input type by checking if ANY key on keyboardd/joypad is pressed 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges