While it's easy for me to get a object circle around another and move toward it, i've got a few problems I couldn't find a solution to, yet.

Ill go here as follows: I) description of scenario II) problems I currently have

I) Description: My setup consists of multiple things:

1) I have a solar system - basically some planets rotating around the sun in a fixed circular motion with the sun itself unmoving. This one works fine - I currently do it with rotateAround in Unity, but I read into force related methods and I think I'm able to get it designed with forces if needed.

2) Space ships. These ships are either circling around a planet (kind of "i'm stationed here") or moving toward another planet (to station them somewhere else) The movement towards a planet as well as the circling around the planet for itself is easy as far as im concerned.. just some move-toward-point stuff or rotateAround point again. I could those 2 implemented with forces too.

II) the problems I have.

1) I can't get my head around a smooth transition from flying toward a planet into the rotation. My first idea was to use some kind of states for the ships "CIRCLING" and "FLYING" and change the state as soon as the desired orbit height is reached. (btw: I use a 3d environment but for the gamelogic I only require the motion to happen on 2d x-z axis only, if this is important to you). The problem with this is, that it's kind of a 90° turn and really looks bad.

2) the next thing i had was to just add another "Transition" state, when I get close enough, which will handle the smooth movement into the circular motion, but I don't know how to do it.

3) Do I have to care for anything else because the target I want to rotate around is moving itself? (so it doesn't look like they speed up when moving around the planet in same direction of the planets movement, while seeming extra slow when moving against planets movement)? (I ask this, because currently I only work with static planets to get the ships movement correct)

So basically my question is: How can I implement this transition? (I don't care if it is a statebased approach with directly applied position changes (with relation to time for constant speed) or if I have to use rigidbodies and forces or if you come up with something else.)

and as an addition: I also need the ships to avoid planets when travelling somewhere - so I was thinking about using the steering behaviour for collision avoidance, which in my understanding would work well with a force based approach, but I didn't completely wrap my head around that yet. (I don't want an answer to this part here, but wanted to provide you with a more complete specification of problems, which has to be possible to mix into the approach without hacking something together badly ;)).

thanks for any help, advice, links to useful resources :) kind regards

  • \$\begingroup\$ What is your goal? It appears that you want (and expect) to have a solution that looks and feels like real orbital mechanics but is somehow simple to implement. That is a no-go, start to finish. Orbital mechanics actually IS rocket science; and everything will have to drive from the forces. If your goal is a simple implementation, stop thinking that it will somehow look realistic. \$\endgroup\$ Commented Dec 29, 2017 at 13:16
  • \$\begingroup\$ I feared that this would be the answer... Often enough there are simple enough ways to simulate something, that works fair enough to look kind of realistic that is simpler than the actual physical thing but wouldn't be good enough for precise physical usecases. I hoped that this applies for orbiting objects and the transition between flying somewhere and orbiting. If that is not the case, I will have to dive deep into the science behind it then, which is not what I wanted but what I will have to do ;) It does not have to be 100% realistic - my current transition however is a instant 90° turn.. \$\endgroup\$
    – MrLowbob
    Commented Dec 29, 2017 at 14:30

1 Answer 1


Instead of laying your approach vector on the line connecting the target to the current position, lay it along one of the tangents to the desired orbit from the current position. Than make just a speed change at the point of tangency.

This is actually quite similar to how real orbital mechanics is performed, so should feel quite natural in addition to being simple to implement.

  • 1
    \$\begingroup\$ Tangents... so obvious! Thats one of the moments, where I want to facepalm myself xD. Thanks that is a great help. Ill see what is coming in over the rest of the day, but at the moment thats my accepted answer already. It removes the need of a classic transition or I could use it as I get closer to the planet in order to get the transition in correctly. \$\endgroup\$
    – MrLowbob
    Commented Dec 29, 2017 at 14:45
  • \$\begingroup\$ Yes; a direction shift at about 10 or 15 radii will probably be subtle enough to work. \$\endgroup\$ Commented Dec 29, 2017 at 14:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .