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 Creatom_Games · Jun 05, 2018 at 04:11 PM · layerssorting layerssorting order

object always appears in front of another

This problem is really annoying and I have been at it for a couple days. I have two objects involved with this problem: a non-moving island and a player. I want the player to appear in front of the island. so I put the player in a different sorting layer. But this didn't seem to work so I tried multiple methods, including fiddling with the Z-Axis of the player, and I even changed their order within the layer, and watched the Sorting Layer tutorial. Nothing seems to be working; the island stays in front of the player! Here are the sprite renderers of the two objects, the first being the player and the second being the island. alt text alt text I'll comment a picture of both objects below the question. Thanks!

problem-3.jpg (35.4 kB)
problem-4.jpg (34.6 kB)
Comment
Add comment · Show 1
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 Creatom_Games · Jun 05, 2018 at 04:12 PM 0
Share

Here is a picture of both. alt text

problem-2.jpg (58.6 kB)

3 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Creatom_Games · Jun 06, 2018 at 03:43 PM

Hey guys, I figured it out using a dumb but workable solution.

I just made an empty gameobject, put the same components as the player in it, set it to a higher layer than the island, and it worked! The problem was about the player itself and not about the island. I wish their was a better solution, and I going to do more research into this.

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 EXZ_EXZ · Jun 05, 2018 at 04:55 PM

Your Player just needs a higher order in the layer! For example: Green: default layer, order in layer -1, Blue: default layer, 0, and Pink: default layer, 1. All the visible objects have the same layer but with a different order.

alt text


layers.png (7.6 kB)
Comment
Add comment · Show 4 · 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 EXZ_EXZ · Jun 05, 2018 at 04:57 PM 0
Share

for more information check this out: https://docs.unity3d.com/$$anonymous$$anual/Layers.html AND https://answers.unity.com/questions/726726/which-is-the-difference-between-layer-and-sorting.html

avatar image Creatom_Games · Jun 05, 2018 at 05:23 PM 0
Share

So I have already tried this method and I tried it again, still the player shows up behind the island. I set the player's order in the layer to 1 and the island's to -1. Both are in the default layer.

avatar image EXZ_EXZ Creatom_Games · Jun 05, 2018 at 05:46 PM 0
Share

plz restart unity - just to be sure ... both layers and order in layer should fix your problem. In the meantime i will search for similar problems :)

avatar image EXZ_EXZ Creatom_Games · Jun 05, 2018 at 06:06 PM 0
Share

plz take a look at this and compare it with your own project:

https://ibb.co/bH03yT it's an image - for some reason i couln't upload it via unity ...

avatar image
0

Answer by koushikB · Jun 05, 2018 at 05:18 PM

Go to layers on the top right corner -> Hit Edit Layers. You'll see tags and sorting layers. You can drag each sorting layer up and down using the handle on the left.
The higher the layer is in that list , the deeper it does into the screen.

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 Creatom_Games · Jun 05, 2018 at 05:27 PM 0
Share

I have already done this for my layers and it doesn't seem to be working as well.

avatar image koushikB · Jun 05, 2018 at 05:46 PM 0
Share

Hmm. This is weird.. Try.. 1.Having them in the same sorting layer and changing the z value. 2.Going into 3D $$anonymous$$ode and manually panning them by selecting the gameObject and pressing w. 3.Create a background sorting layer , pull it to the top , and set your islands sorting layer to background. 4.If nothing works.. I think you found a bug.

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

85 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

Related Questions

Layers out of order can anyone help? 0 Answers

Sorting irregular objects in 2D isometric view 0 Answers

3D object in 2D game 1 Answer

Isometric Tilemap Characters Z-Fighting Causing Flickering 1 Answer

How to show part of the screen only for specified sorting layer? 0 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