I’m trying to make a program that simulates planets and gravity and I’m using a method of simulating gravity explained in this response to a post I made a while ago. This works just fine, the only problem is it only works for kinematic objects while I need dynamic type collisions for when a object collides with the planet. Is there any way to make this work or alternatively to change this code to work with dynamic objects?
I still think this is the most viable solution in your case.
Also, this is a very simple approach that might work well!
Essentially a variation of the forces I suggested.
Perhaps this could be helpful?
Also - @sergey.lerg - I think you might have an experience with gravity and planets, since I remember the mobile game with this you were working on - am I right?
Yes! I’ve made a planet game https://youtu.be/sK4pJ8A3YS4
Used my box2d extension. Pretty straightforward. Dynamic type for planets, applying forces based on their distance to each other. Like a normal gravity formula.