0 votes

My project is using the unchanged default gravity which has a value of 98. The tooltip says this value represents an acceleration in pixels per second squared. I wanted to confirm with the following method:

  1. Create a RigidBody2D with a CircleShape2D with radius = 10 and position.y = -10. This resulted in the bottom of the circle being at y = 0.
  2. Create an Area2D with a RectangleShape2D with extents.y = 10 and position.y = 610. This resulted in the top of the rectangle being at y = 600.
  3. Measure the time it takes for the circle to fall 600 pixels and hit the rectangle. This took about 3.74 seconds.
  4. Calculate the predicted distance dropped in pixels using x = vi * t + 1/2 * a * t^2. I calculated x = (0)(3.74) + (1/2)(98)(3.74^2) = 685 pixels.

This is significantly different than the expected 600 pixels. Where is the inconsistency? Is it in my method to calculated distance dropped? Are there other physics factors I am not taking into account? Or does the default_gravity property mean something different than my current understanding?

Godot version 3.4.2
in Engine by (156 points)

1 Answer

0 votes

I am not good at physics.

But if I 'don't misunderstanding, I think the fomula you use(x = vi * t + 1/2 * a * t^2) is a free-fall body formula.
For the ideal situations, an object falling without air resistance or friction is defined to be in free-fall.

However godot's RigidBody2D node did have some resistances, for example "linear damp" and "angular damp".
And godot's project itself alse have some resistances, for example "default linear damp" and "default angular damp".

I guess maybe that's why it's different from your expected.

by (526 points)
edited by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.