Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Beamer159 |
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:
- Create a
RigidBody2D
with aCircleShape2D
withradius = 10
andposition.y = -10
. This resulted in the bottom of the circle being at y = 0. - Create an
Area2D
with aRectangleShape2D
withextents.y = 10
andposition.y = 610
. This resulted in the top of the rectangle being at y = 600. - Measure the time it takes for the circle to fall 600 pixels and hit the rectangle. This took about 3.74 seconds.
- Calculate the predicted distance dropped in pixels using
x = vi * t + 1/2 * a * t^2
. I calculatedx = (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?