Fun with Gravity in Unity
This video shows a simulation of gravitation in Unity. The video shows how each object affect each other. The spin movement of the massiv central object shows how the small objects with low mass can affect a massiv object. If an object hit the central object it will be destroyed and a new one is spawned. Every object starts at a random position with a random mass and a random velocity vector.
The gravitation is calculated by Newton's Law of Gravity.
F = G * (m1 * m2)/r^2
G = gravitational constant
You can download the simulation at GitHub
GitHub Project
Dirk Jacobasch
Unity Developer - Programmer
Dirk Jacobasch
a year ago
Unity Developer
After someone asked me to share the code of the project I decided to share the whole project at GitHub. Have fun with it.