• 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: 

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

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

Planetary based gravity 0 Answers

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

I have a planetary gravity script; how do I make the object speed up? 1 Answer

Player in Spaceship 2 Answers

How to simulate moon gravity? 3 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges