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 Knskan3 · Jan 09, 2017 at 09:05 PM · cameraspritestopdownisometricsorting

Proper/Standard way to create a top down / isometric sprite sorting solution

Hi,

For my next game I'm trying to create a game with a camera similar to "Age of zombies, Zelda minish Cap, Hyper light drifter, etc" Top Down tiled ground with sorted sprites for characters, items, npcs, buildings...

Now I wonder whats the proper solution for sprite Y sorting.

I've been reading a lot about this topic.

I found two groups:

a) People who approaches the game in pure 2D. Using a "spriteRenderer.sortingOrder" solution, either on late update for each element or for specific elements when they collide to others.

b) People who takes a real 3D solution. Using flat ground (maybe tiled) and sprites facing the camera (you have to update their rotation every time)

I'd like to know whats the best one, I don't want to take a solution just because you can do it in some way but based on real experience.

What do you think?

Thanks a lot!

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 tanoshimi · Jan 09, 2017 at 09:24 PM 0
Share

Well, we're making a game using 2d sprites positioned in 3d space using a perspective camera, which I guess counts as your option b.), but I'm not sure what you mean by updating the sprites rotation every time? Billboarded sprites always face the camera direction - there's no additional work required.

avatar image Knskan3 tanoshimi · Jan 09, 2017 at 09:38 PM 0
Share

You have if you rotate the camera, not my case jj.

avatar image Knskan3 tanoshimi · Jan 09, 2017 at 09:40 PM 0
Share

Do you have any screenshots of your progress in twitter or smth?

avatar image tanoshimi Knskan3 · Jan 09, 2017 at 10:19 PM 0
Share

This is our desert environment. We use a perspective camera so the positioning of the player among the stones, grasses, rocks etc. is resolved by simple Z-sorting. alt text

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by GrayMatterTutorials · Jan 09, 2017 at 09:27 PM

Ever since Unity started offering 2D support, I would say that option A became the norm. Option B would've been the way of handling it before the support was offered. I would suggest using option A. If things are going to be constantly moving, Late Update may be appropriate, but another option would be to determine if the object actually moved before updating it. For instance, you have a tree that is static. That will never need to have it's sorting order updated. If you have a person, they may be updated quite frequently, but a non-playable character who just sits in one spot waiting for the player to purchase something from them might not need to be updated at all. Likewise, a box that can be moved by the player should only be updated when it is moved! I would say that you should have a Boolean value stating that the object is moving, and when it's moving in the Late Update function, set the sortingOrder to the y value. This will be the most efficient way of doing it rather than every object constantly changing their sorting order. You could also have this functionality in a class/component of it's own and any class needing to sort will have a Require Component Attribute at the top of the class.

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 Knskan3 · Jan 09, 2017 at 09:40 PM 0
Share

What about if you have many of characters, monsters, they will be colliding each other, causing a lot of updates every time frame if they are surrounding you?

avatar image GrayMatterTutorials Knskan3 · Jan 09, 2017 at 09:45 PM 0
Share

I don't understand the question. Are you stating that those updates will occur anyway? If you are, they actually don't. Yes, they will cause an update to occur, but every frame they don't hit you, an update isn't being called and a little less memory is being used as this occurrence snowballs and more and more updates don't occur. If they move, they update... if you move, you update... If you move, you both update. However, in the long run you are, not everyone is constantly updating.

If that wasn't your question, feel free to comment with a more direct question and I'll respond to it the best way I can.

avatar image Knskan3 GrayMatterTutorials · Jan 09, 2017 at 09:48 PM 0
Share

In this approach, whats the actual benefit from using 3D camera where you same all the scripting? I read some posts around this and people just use it because 2D is now "natively" supported by unity. It feels like both options come with pros and cons, I'd like to have some heave reason to use one ins$$anonymous$$d of the other so I don't regret when project is 60% completed.

Show more comments

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

91 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

Related Questions

Constrain axis of isometric camera ("vertical" only) 0 Answers

Isometric Camera : Get the displayed terrain portion. 1 Answer

Vector art Player 0 Answers

Unknown light from orthographic camera 0 Answers

Place GUI Text Under 2D Sprite 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