Custom gravity engine not working

Hi, in Unity, I have been attempting to create a basic custom gravity engine to apply gravity on a local level. I have been attempting to incorporate drag into this engine so heavier objects fall faster than lighter ones. The code below partially works, except I have noticed a strange behavior where if two objects, one weighing 10kg, and another weighing 1kg, are in an area with the same fluid density, and have the same force applied to them in the same direction. The 10kg object will gain speed much faster than the 1kg object, even in directions opposite to gravity.

This does not appear to be a normal behavior. Have I done something wrong?

If you can leave a reply, I will be most grateful.

            Rigidbody2D rb = other.GetComponent<Rigidbody2D>();
            rb.drag = 0;
            rb.AddForce(force * rb.gravityScale * rb.mass); // force is just the gravitational force in m/s

            Vector2 velocity = rb.velocity;
            float speed = velocity.magnitude;

            // Drag equation: F_drag = 0.5 * air density * coefficient * area * velocity^2
            float dragCoefficient = 0.47f;
            float crossSectionalArea = other.GetComponent<GravityObject>().crossSectionalArea;

            float dragForceMagnitude = 0.5f * airDensity * dragCoefficient * crossSectionalArea * speed * speed / rb.mass;
            Vector2 dragForce = -dragForceMagnitude * velocity.normalized;

            rb.AddForce(dragForce);

Well you’re scaling by mass. Maybe you meant inverse mass (1 / mass). That said, I’m not sure why the gravity term is used here and it’s not clear why you’re scaling the initial “force” by the gravity scale.

When you add a force, that value will be time-integrated into velocity after it’s scaled by inverse mass. Maybe you’re scaling by mass to try to counter this?

I’d say just sum-up the force (or impulse) you want to apply and add it once. That way it’s at least easier to debug. From what you’ve said, you’ll see more force being added on one than the other so you can debug why.