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 $$anonymous$$ · Dec 17, 2016 at 04:41 PM · uiimagechilddraworder

Vertical Layout draw order, child appears above parent

Hello everyone! I need to draw a slot image in front of box image and follow its position, easy - place down it in the hierarhy, but i have slot in the object that has vertical layout group. And i dont know why parent appears in front of child? Can anybody help? :) Thanks in advance.

alt text

alt text

без-имени-1.jpg (319.1 kB)
без-имени-2.jpg (275.9 kB)
Comment
Add comment · Show 4
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 Glurth · Dec 17, 2016 at 04:55 PM 0
Share

It looks to me like the small skill-box DOES get drawn over the larger box. The frame of the skill-box does look messed up, but I suspect that's a different issue. If I misunderstand, please clarify.

avatar image Mehrdad995 Glurth · Dec 17, 2016 at 05:10 PM 0
Share

at first i thought he means that the skill is not above or in front of the box in terms of layer sorting but i guess he means the skill placement is not at the middle top of the box.

avatar image $$anonymous$$ Mehrdad995 · Dec 17, 2016 at 05:21 PM 0
Share

I mean how can i make box to appear in front of the skill, so you dont see those ugly yellow lines.

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Mehrdad995 · Dec 18, 2016 at 09:00 PM

in order to draw parent above its child you have to follow these steps :

  1. create a material and use the "UI/Default" shader on it.(any shader works but the UI default is almost the one used for UI elements by default so you wont notice any change to your UI image).

  2. assign the material to the parent object.

  3. select the material.

  4. switch the inspector to debug mode.

  5. increase the value of "Custom Render Queue" something above 3000 would be fine.

**Note that as far as i know you can also use an overlay shader without the need to change "Custom Render Queue" value.

**In conclusion I personally advise you not to do so but make both the box(parent) and the skill(child) children of another empty gameobject so you can move them up and down in hierarchy to sort the layers, because using different materials in UI will significantly increase drawcalls!

alt text


001.jpg (305.8 kB)
Comment
Add comment · 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
0

Answer by Creeper_Math · Dec 18, 2016 at 09:12 PM

On the object you want to be under the other, set it's "order" in the inspector to -1 and it should work...

Another one that may be easier to do is set the "z" position to either a positive or negative value...

Comment
Add comment · 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

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

90 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 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 avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity 4.6 UI - Image Order 4 Answers

Possible to use sprite mesh for UI.Image GraphicRaycaster culling? 1 Answer

Locking Rotation of UI Elements Relative to Canvas (VR) 1 Answer

Removing color tint from image/raw image on Canvas Sprite,Color tinting Canvas sprite in image/raw image 0 Answers

Image in Button is cut (New UI) 2 Answers


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