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 douglasg14b · Apr 05, 2015 at 07:39 PM · camera2daxis

Creating a 2D game on the X-Z plane, any adverse effects or challenges with this?

After coming to the realization that some things I wish to do in a 2D RTS are easier to do on the X-Z plane instead of the default X-Y plane, I'm considering moving my game over to the other plane.

What I am wondering, past the scripting changes to accommodate the different plane, is what specific challenges will this cause for a 2D game (using 3d physics, not 2d physics)? I did a test and flipped some assets to the X-Z plane and things seemed to work just fine, though I am not sure what unique challenges I will end up facing are.

Edit: all our objects will have a 90 degree X-Axis rotation.

Edit2: Apparently a 90-degree x-axis rotation doesn't play well with pathfinding, and movement in general. I'll need to find a solution to have the sprites render on the X-Z plane instead of the X-Y plane.

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 moxiewhimsy · Apr 06, 2015 at 02:04 AM 0
Share

For that application, 2D RTS, moving to the X-Z plane just makes sense.

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Xarbrough · Apr 06, 2015 at 01:01 AM

What is your argument for using XZ instead of XY? I can't think of any.

Generally, it doesn't make any difference, if you sync up all your components, axis are just names. But keep in mind that all Unity components assume the XY plane. Locked scene camera points there, Mouse and screen events are using XY, 2D Physics and so one, why would you want to change all of those settings? If you need different gravity, just flip the Physics axis in the settings to make your objects fall along the Z axis. At least that is my recommendation, but maybe you have a very good reason to prefer standard world coordinates in 2D.

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 douglasg14b · Apr 06, 2015 at 01:44 AM 1
Share

Nav meshes, pathfinding, and steering. Assets that do these things seem to prefer to X-Z plane over the X-Y plane. And as far as I can tell Unity's nav mesh doesn't even work on the X-Y plane. I'll be using the 3D physics engine anyways, so that's not much of a loss.

avatar image Xarbrough · Apr 06, 2015 at 11:19 AM 0
Share

You're right, Navmesh is the one example that prefers XZ and isn't changed easily. If you're having trouble with rotated assets, maybe you can fix it by parenting your objects under an empty zero rotation GO. Then also assign your colliders and movement to that ins$$anonymous$$d of the actual model, which should just be visually only in that case.

avatar image
0

Answer by betaFlux · Apr 06, 2015 at 11:42 AM

It really doesn't matter. You can't go wrong with xz. That's what I also do at the moment, and as douglasg14b already stated, it is the best choice for when you work with navmeshes or common pathfinding systems. And if you are doing a 2D top down game like me, it feels more natural to have y as your up axis.

The only difficulties that came up were related to 2D lights and shadows. There are some very nice solutions for that in the assetstore, which sadly work with the common xy plane system only.

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 AndreiMarian · Nov 08, 2016 at 07:13 PM

It's a matter of naming just as well as when you want to steer left you'd have to say "rotate by forward axis" instead of "rotate by up axis", not to mention translating forward, left etc. - they're all messed up. So here are some possible solutions: 1. Just suck it up and memorize how to use the messed up names. 2. Make the renderer object a child of an already rotated go. 3. Instead of using the sprite renderer you can make a quad with the sprite texture but you loose sprite traits like pivot etc. 4. The most elegant and straightforward solution: wait until Unity comes up with a really useful checkbox like "render in xz plane". Unfortunately this is also the most unrecommended solution.

Although all the answers of this commonly asked question starts with something suggesting you don't want to do that, as if users don't even know what they want, then what I consider more useless is the "flip x" and "flip y" checkboxes, as if the users couldn't do that in... Windows Paint.

And yes, I'm still searching for a way to make the Sprite Renderer render on xz.

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

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

23 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

Related Questions

How do I lock Y Axis movement for Parented Camera? 3 Answers

Camera moving in one direction? 2 Answers

Lock main camera on x-axis 2 Answers

2d axis is not shown 1 Answer

2D Orthographic Main Camera and UI 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