• 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 Hez · Jan 14, 2014 at 05:01 AM · c#movementcharactercontrollergravityplanet

Round Planets and Movement on them

For a game I am making I need a way to move along a round surface and have a poll to the center. I need a few thing, I need to be able to fall towards the planet, I need to move across the planets surface without going off in odd directions, and I need for "Up" to be away from the center at all times.

I have googled this in every way I can, and the only things I found caused more issues then fixed. It has come to the point where I am sure there is no way to have a round game world!

Comment
Add comment · Show 2
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 KellyThomas · Jan 14, 2014 at 05:05 AM 1
Share

Here is one approach.

avatar image HappyMoo · Jan 14, 2014 at 05:08 AM 0
Share

Ah, so if you're that sure, why do you even ask? Got you...

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by HappyMoo · Jan 14, 2014 at 05:19 AM

These guys talk a bit about the problem: http://www.youtube.com/watch?v=wTFvlzLvIPs

I wouldn't do 3D gravity pointing to the planet center, but calculate the gravity force as a float and only in the last step apply it in the direction of the center of the planet. You're basically managing the players height above planet ground as if if was 2D, just that your negative y coordinate is pointing to the center at all times.

Also rotate the player, so his feet always point to the center and then you just basically apply horizontal and vertical movement, but from the players perspective.

Watch out that you don't use euler angles anywhere or gimbal lock will bite you.

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 getyour411 · Jan 14, 2014 at 06:43 AM

I happen to be working on the same thing for my game and got it working with the help of this post http://answers.unity3d.com/questions/613676/apply-a-new-vector3up-to-adjust-player-normal.html

While I don't use the JumptoWall stuff yet, the other code provides what I needed to walk around my somewhat spherical model 360degrees. I was able to modify it such that I didn't need my player to be a child of the boxcollider/rigidbody object, I just added those to the player and turn them on/off when I need them or don't.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



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

Making a bubble level (not a game but work tool) 1 Answer

Gravity for my AI 0 Answers

controller.Move doesn't stay grounded when walking down slope 3 Answers

Character Controller / Charactor Motor has no inputs? 1 Answer

How to hold objects in third person? 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