I am new to UE4, but not new to programming. I am playing around with the flying template. I have added two sphere, and am wondering how one would go about disabling gravity in the game, but having gravity be on the sphere - like a planet.
If anybody has any links to something that could help it would be great.
Gravity in the engine works in a way that assumes the world is “flat”, so gravity always moves in a single direction. if you want to make it work for a spherical object, the best way I can think of would be to create a radial force positioned at the centre of your sphere. Normally the force would push outwards, but if you put in a negative value it will suck objects toward it, just like gravity of a planet pulls objects towards ints centre.
go into the project settings and turn off gravity. You could also go as far as working out the correct gravity for each planet my multiplying it by its mass, or its overall volume.