Is there a way to make objects orbit with the inbuilt defold physics? I want to make a 2D space flight simulator/space simulator and I wanted to know if there was a way to make one object orbit around another. I’ve messed with the masses of my objects however nothing happens, they just sit there (I set physics XYZ to 0 in-game.project) if anyone could point me in the right direction to making my own physics/making orbits with the in-built physics engine that would be great
I believe the mass is only used when simulating collisions etc. And there is no gravity between objects. You need to implement this yourself.
You can either use a fully kinematic solution where you do all of the physics calculations yourself, or you use dynamic objects and the apply_force message to pull the objects in different directions.
Since you’re mentioning “around other objects”, I’d say you need your own custom implementation.
It would be very convenient if we supported force fields in the engine, but it’s certainly doable yourself. E.g. by using triggers or kinetic objects as @britzl suggested.
Ok, thanks for the help