Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 fuyiii · Feb 14, 2015 at 07:04 PM · prefabsuser interface

unity GUI: Place a prefab in front of another one

Hi experts, I made 2 prefabs: A, B. I want A to be in front of B. however no matter how I change the hierarchy, B is always in front of A in the game window.

Any idea how I can resolve this?

Any input is greatly appreciated! Thank you!

Comment
Add comment · Show 3
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 opponent019 · Feb 14, 2015 at 08:23 PM 0
Share

In front in the game window... you mean as in closer to the camera? Have you tried moving one of them in Z axis? I'm guessing you're a newbie and are using 2D mode, in that case look for a button that says 2D over your game window, to the left of the activate/desactivate lights button, this way you can see the world in 3D and easily move around objects in z view.

avatar image fuyiii · Feb 16, 2015 at 06:34 PM 0
Share

Thanks for the reply Eirikra, I am really new to Unity. I tried to move them in Z axis,in the scene window I can see that A is above B, but in game window nothing changed. any thoughts?

avatar image opponent019 · Feb 16, 2015 at 08:43 PM 0
Share

The order that the objects are in the outliner doesn't matter, they're not layers like in Photoshop, they're just listed there as in any other 3D software; it doesn't matter if they're above or under each other in there but their position in the world. If you want to put something above other stuff in the game screen you should move them in the Y axis, if you want to put something infront then Z axis, that's it. If putting A on (0,0,1) and B on (0,0,0) still shows B in front of A and your camera is in positive Z then I have no idea what's going on o.O would you $$anonymous$$d illustrating (screenshot)?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Raynoko · Feb 15, 2015 at 04:31 PM

try use SiblingIndex

Comment
Add comment · Show 2 · 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 fuyiii · Feb 16, 2015 at 08:40 PM 0
Share

so I have to go through code?

avatar image Raynoko · Feb 17, 2015 at 08:07 AM 0
Share

yes u can

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Any way to change the default canvas parent when opening UI prefabs in the new Prefab editor. 1 Answer

Is there a way to sort UI elements overriding the hierarchy? 0 Answers

Line from Parent to Children on UI 0 Answers

Problems assigning sprite's images 1 Answer

SetActive true not working on UI object 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