Moving Atmosphere

Hello everyone,

I am creating a planetary game in which a first person character can walk on the surface of an orbiting planet. I have all the gravity and orientation done, however, when the planet moves, rigid bodies near the surface need to have air resistance or they’ll not be caught by the planet. Since, the planet is moving I cant use the drag built into unity. Somehow I need air resistance that is relative to the planet’s velocity and rotation. Later on I will adding space stations, so in a more broader sense I need an area of influence for air resistance that moves with the defined object. Does anybody have a plan on how I could achieve this with scripts. I already know the air resistance equation.

Thanks,
Austin

Hmm interesting question…

It’s not so much air resistance in this case… at least the default rigidbody drag won’t work…

I’d try Slerping the orbiting rigidbody’s velocity to that of the planet… use ‘air resistance’ as the scalar (this will be a very low value, something like 0.0001)… the orbiting rigidbody will gradually match velocities with the planet… I think…

After this you apply gravitational force to the orbiter, so that it is attracted to the planet after it’s been slowed down

Hope this helps

Cheers

Yeah I already have the gravity, however I did not think it would be this simple. I would still have to adjust for the rotation though however I think I can do that. Thanks for the advice.