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
1
Question by BlackRobotSoftware · Feb 27, 2014 at 09:36 PM · gravityaxis

Can you apply gravity on the Z-axis instead of Y?

I'm translating a 2D card game to Unity. It will have a fixed, 2D-like perspective, but I will be using the 3rd dimension for some aspects like stacking cards or dropping one on the table from a particular height.

Does it matter if I lay out the table so that it is laying down on the Z plane, or could it also be "standing up" vertically so it's surface is on the XY plane?

Coming from a 2D game, I'm used to the latter, where the table dimensions are on the X and Y axis. But out of the box, this would mean gravity would apply in a dimension parallel to the table surface, not perpendicular to it. Can I simply change that? Does it matter which axis I lay out the table on?

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

1 Reply

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

Answer by robertbu · Feb 27, 2014 at 09:40 PM

Assuming you are using 3D physics for this game, you can leave your table on the XY plane and modify gravity in Edit > Project Settings > Physics. There are a few other places in Unity that assume 'y' is up (like Transform.LookAt() and Quaternion.LookRotation()), but they have optional parameters so you can make the change to another axis being up.

P.S. Your title is misleading. Gravity is by default applied on the 'y' axis. If you present your table on the XY plane, you will want your gravity to be applied on the 'z' axis.

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 BlackRobotSoftware · Feb 28, 2014 at 08:52 PM 0
Share

Thank you, exactly the specific answers I was looking to have confirmed! I've edited my title - you are correct. 3D can get confusing. :)

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

20 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

Related Questions

How can I calculate the force required to contradict gravity?2d 2 Answers

Rotate AI towards target, on single axis? 1 Answer

Mimic Gravity Movement Via Setting Velocity 0 Answers

Use Mouse as Direction for Character Movement? 0 Answers

Possible to create axis centered gravity? 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