• 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 shemer77 · Jun 01, 2016 at 02:43 PM · 2dgravityplanet

Have rigid body enter a planets orbit but always be able to escape it

I'm trying to create a 2D top down game where players can launch balls and it will zoom around the map and be influenced by different planets when it enters their respective field of gravity. I'm just thinking ahead here but I believe occasionally I will enter a scenario where the ball is going to be stuck in the planets field of gravity obviously bringing the game to a halt. Is there any sort of ways I could avoid that?

My idea is maybe decreasing the strength of gravity the longer the ball spends time in the field of gravity

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
0

Answer by aWolfKing · Jun 02, 2016 at 11:45 AM

I think you should add velocity in the opposite direction of the gravity-vector and make it biggen than the gravity (force) so you can escape the orbit. The main problem whould be making it look natural; so maybe to keep it looking natural you could try to temporarely lower the gravity if you detect the player whants to exit the orbit. Becouse of the lower gravity you will have more control (I think) to make it look natural.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How can I make a gravity field similar to a planetary body? 2 Answers

Fully understanding the gravity of the situation 2 Answers

Unity 2D Cube Planet Gravity 0 Answers

2D Top Down Character being Pulled down and movement script not working? 2 Answers

Why is Quaternion.FromToRotation() not working properly? 3 Answers

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