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 /
This question was closed Sep 24, 2013 at 09:34 AM by Fattie for the following reason:

Duplicate Question

avatar image
0
Question by criddle98 · Sep 24, 2013 at 01:06 AM · physicsgravityspaceplanet

Adding a force(gravity) to a planet.

Hello guys! I am creating a space game in which you will be able to land on planets and explore them in their entirety. However, my trouble is finding a way to add a force(Gravity) to the player so they don't just fall of the edge of the planet! (Another problem would be trying to fix the problem of everything reversing when on the opposite side of the planet... But that can be resolved at a later date) My thought was adding an empty object in the center of each planet and "pull" the player towards it, however I feel this method is too risky and may lead to more flaws in the future. I am planning on having terrain on the planet so there will be imperfections. I know this might create a problem, so I mentioned it ahead of time. If anybody knows an alternative method to resolve my problem, help would be greatly appreciated! I am also pretty new to scripting in Unity3D! Thanks!

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 robertbu · Sep 24, 2013 at 01:19 AM 0
Share

This is a question that has been asked and answered a number of times. Adding force in the direction of the center of the planet is generally the solution. You don't need an empty game object, just the position of the planet. If you are looking for a more realistic solution based on the mass of the planet and the player/ship, take a look at the wiki script:

http://wiki.unity3d.com/index.php/Gravity

avatar image Fattie · Sep 24, 2013 at 09:35 AM 0
Share

could moderators simply delete duplicates so I don't have to. just click "close" and then "ok"

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

16 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

Related Questions

Artificial Gravity 2 Answers

How do you create a continuous physics simulation in Unity? 1 Answer

Planetary based gravity 0 Answers

Player in Spaceship 2 Answers

I have a planetary gravity script; how do I make the object speed up? 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