Gravity does not correspond to body mass

I am trying to balance the attached lifting force with the force of gravity acting on the body.

I use Rigidbody, built-in gravity == 9.8 and AddForce(). Whatever the mass of the body, it breaks off from the surface before the lifting force reaches 9.8 body weight.

The average value of the coefficient is about 3.5. From the point of view of physics, it is a constant measured in newton/kg or m/(s^2). Why is it so far from 9.8?

The worst thing is that it changes noticeably.

I’m new to Unity and so I admit that I made a mistake in the settings, but my search in the documentation did not yield results.

Most likely you’re applying the force from Update(), instead of FixedUpdate(). Update() is frame rate-dependent. What you describe is a force being applied multiple times between each physics update.

So for example, if you apply a force of 3.5 N from Update(), it may happen that force is applied (and accumulated) three times before the next physics update. This means that when the physics updates the simulation, it encounters a force of 3.5 x 3 = 10.5 N applied to that rigidbody, thus lifting it.

The value changes noticeably because, as said, Update runs at the visual frame rate. Some times will be higher, others lower, depending of the visual frame rate fluctuation with respect to the physics rate.

Always use FixedUpdate() instead of Update() for your physics related stuff. FixedUpdate() runs at a fixed rate in sync with the internal physics update.

1 Like

Thank you for your quick response!

I actually use Update(). Your reasoning seems logical. I will try to do as you said, and later I will write here what happened.

Your solution works perfectly.

1 Like