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
7
Question by Tatanan · Jun 13, 2014 at 04:05 PM · layerssorting

Which is the difference between layer and sorting layer?

If I'm not wrong, on 2D games, the sorting layer have preference over the z position for showing layers. After the sorting layer, the order in layer is the next more important value, and only after this one, the z position. Am I right?

Also, what's the layers (not sorting layers) for?

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 iwaldrop · Jun 13, 2014 at 04:34 PM 1
Share

Regular 'Layers' are used for setting up physics collision rules and camera culling. You can view the Layer Collision $$anonymous$$atrix by going to Edit/Project/Physics. You can remove Layers from Camera Culling $$anonymous$$ask(s) by selecting a camera in the Hierarchy or Scene View, and finding the Culling $$anonymous$$ask drop-down in the Inspector.

2 Replies

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

Answer by Tekksin · Jun 13, 2014 at 09:57 PM

if I'm not mistaken, the sorting layer is used for 2D games. You have the name of the sorting layer, and then the number below it. So say you have 2 enemies (bing and bong), and you want bing to be in front of bong. Well, then you would tag them with an "enemies" sorting layer, made by you (doesn't have to be named enemies, it's your choice), and you would put bing on sorting layer number 2, and bong on sorting layer number 1.

Other sorting layers can be made for things like the player and decorations. You would place those sorting layers in the appropriate orders.

The regular "Layer" tagging option up at the top is for collisions (for me). You would tag things with layers. Pretend you didn't want bing and bong to touch, because they're enemies. You would put them on the enemies layer, and ensure in edit>project>physics/physics2D that where the horizontal and vericle lines meet is unchecked for the enemy titles. The rest of the layers shows what the enemies will hit, unless unchecked in the respected column.

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
28

Answer by ClockworkCoyote · Dec 20, 2016 at 05:41 PM

Sorting Layers are how objects are seen by the camera. This becomes obvious when you remember that sorting layers are attached to the renderer. Therefore, sorting layers (and order in sorting layers) determine how objects are rendered in the scene.

Layer, up there next to tags, is for grouping objects. Maybe you have a bunch of objects that are similar in that they will be rendered differently from other objects. They would be on different layers. Or, if only certain objects are supposed to be collidable and some are not, they would be on different layers.

Sorting layers are visual.

Layers are functional.

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 bab202 · Feb 27, 2019 at 09:49 AM 0
Share

Thank you for the explain!

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

8 People are following this question.

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

Related Questions

Problem with lights in 4.3 1 Answer

Unity sprites and sorting layers messed up 1 Answer

Layers out of order can anyone help? 0 Answers

Particles not rendering on sorting layer specified with sprite-default shader 0 Answers

Canvas UI Priority layers 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