Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Tinho205 · Sep 22, 2021 at 02:02 AM · sorting layerssorting orderrenderqueue

Rendering order approach for a 2.5D game.

First of all, I'm sorry if answers.unity isn't the place meant for this kind of questions or if it is posted on the wrong space.

I'm creating a tile-based 2.5D game and I want the lower tiles to be rendered after the top ones, so it looks like the player is in front of an object (refer to the screenshot). Currently I'm doing it by modifying the render queue when the player is over the object's Y axis but that obviously leads to a lot of bugs. How should I do that?

Thanks. alt text

a.png (31.5 kB)
Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by FlaSh-G · Sep 22, 2021 at 08:25 AM

This should help: https://docs.unity3d.com/2020.3/Documentation/Manual/2DSorting.html Especially the custom transparency sort axis makes this very easy.

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 Tinho205 · Sep 22, 2021 at 04:00 PM 0
Share

Thanks, I'm going to try that. Just keep in $$anonymous$$d that since I'm really new to unity it may take me some $$anonymous$$utes.

avatar image Tinho205 · Sep 22, 2021 at 04:38 PM 0
Share

It is half working. The tree renders under the player only when the player passes half of the sprite size. Is that because of some kind of reference point (pivot)?

avatar image FlaSh-G Tinho205 · Sep 22, 2021 at 06:17 PM 0
Share

Yes! I see you've found out by yourself by now. Make sure your pivots are all on the "ground" of the sprite - the feet, the center of the tree's circle that touches the ground, etc.

avatar image Tinho205 FlaSh-G · Sep 22, 2021 at 07:17 PM 0
Share

That's what I did, thanks for the help! :)

avatar image
0

Answer by Tinho205 · Sep 22, 2021 at 05:11 PM

For future people who have the same problem, HERE is the solution: https://answers.unity.com/questions/1626564/transparency-sort-axis-on-y-with-pivot-instead-of.html

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 Tinho205 · Sep 22, 2021 at 05:14 PM 0
Share

Transparency Sort Mode to: Custom Axis; Transparency Sort Axis to: X:0, Y:1, Z:0; All your sprite pivot's to: Bottom; On the sprite renderer of each sprite set "Sprite Sort Point" to "Pivot".

That should fix your error.

avatar image Tinho205 · Sep 22, 2021 at 05:27 PM 0
Share

Also, changing the pivot of the player also changes the point to wich the camera aims, so change the offset of the camera for fixing that.

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

125 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 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

Place UI text on top of other elements in 2D 1 Answer

Isometric Tilemap Characters Z-Fighting Causing Flickering 1 Answer

2d Animation not rendering in front of background sprite in spite of sorting layers 1 Answer

Nested sorting layers? 1 Answer

Sorting Layer Logic Issue 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