Planetary gravitational pull simulation.

I am trying to create a simulation that simulates real physics. For example if I had the sun (S) and its exact mass and the earth (E) and its exact mass and the exact distance from S, then E would react in just the same way. Of course if I could figure out what force to move the E in the x axis then I could simulate an orbit around the S. But to get a proper simulation of the orbit it has now, I would have to create all of are solar system planets and the dwarf planet Pluto and the asteroid belt. If I want to be even more exact on the orbit I would also add the belt around sauterne and any other belts and any other small asteroids in the solar system and also last but not least (I add no comas to enthuses the realistic components you have to include as for the resin will be explained) the sphere of roughly several trillion small stones that roughly outline the end of are solar system. Even still the fact is that if you only has two objects in the universe lets say objects A:) and B:smile: then no mater how far apart:face_with_spiral_eyes: they are and no mater how small there masses are (say they are electrons or smaller) they will never stay in the same place ever because they are always being pulled towards each other. To give an example of the force applied and how small it is let’s say you have A:) and its 1kg and B:smile: is 10kg and the distance:face_with_spiral_eyes: was 5m then you would find out the force by doing this sum:

:slight_smile: ---- :face_with_spiral_eyes: ---- :smile: = boom :frowning:

G= Universal gravity Constance = 6.67*10 to the power of -11
F = the force
M = the bigger objects mass = 10
m= the smaller objects mass = 1
R = the distance from each other = 25 = 2 to the power of 5

F = G * M * m % R to the power of 2

F = 6.67 * 10 to the power of -11 * 10 * 1 % 5 to the power of 2 = 2.668 * 10 to the power of -11 = 0.000000000002668 lol

And that’s how nothing in this universe can stay still! This is the equation I will use to find out how much force to add to that rigid body lol.

Features so far:
• Auto planet scaling controlled by the mass set in the rigid body of the object
• Auto gravitational radius around object (the distance in which object B is effected by object A’s gravitational pull)
• Auto force applying according to the mass of A and the distance of object B from A
• If the objects collide with each other the object with the bigger mass will take the objects mass and destroy the smaller object

In the inspector
• Distance measurer of chosen target
• Force measurer of object
• Mass measurer of chosen target
• If the objects collide with each other the object with the bigger mass will take the objects mass and destroy the smaller object

This is what i have done so far, this is my youtube channel. Please sugest different fetures, thanks.

P.S. The game is not lagy its the screen recorder.

Take a look at this

http://forum.unity3d.com/threads/51909-Planetery-Forming-Gravity-new-FACEBOOK-Integration?highlight=solasim

I wrote one of those a while back. I’ll post it as an example soon.

Lad i cant play it because it shows up as invalad game or sonthing like that but it looks good.

Alright, the thread is a bit old, But we worked on solving this back then. Maybe it’ll help you some.
http://forum.unity3d.com/threads/8873-Faux-Gravity-making-my-brain-spin…-Help!

Also, live example of a practical implementation (The particles respond to the very same gravity simulation).
http://www.brokentoygames.com/thejump

i can play flud gates which is very good but i cant play your the jump game which looks very good but all i see is different black and white shaders and can hear a sound track which sounds cool and sets the mood for a space game lol.

I want to be able to set several components to a group of objects with the same tag.
I also whant to be able to add a object to the transform in the script automaticly.
Can i do this? And if you can how?

please help thanks.

I notice you are using Newton’s Gravitational equation. What about using Einstein’s General Relativity for more precision…