diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 8e31688d900..bd2253809cc 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -598,12 +598,12 @@ real_t RigidBody2D::get_inertia() const { void RigidBody2D::set_weight(real_t p_weight) { - set_mass(p_weight / real_t(GLOBAL_DEF("physics/2d/default_gravity", 98)) / 10); + set_mass(p_weight / (real_t(GLOBAL_DEF("physics/2d/default_gravity", 98)) / 10)); } real_t RigidBody2D::get_weight() const { - return mass * real_t(GLOBAL_DEF("physics/2d/default_gravity", 98)) / 10; + return mass * (real_t(GLOBAL_DEF("physics/2d/default_gravity", 98)) / 10); } #ifndef DISABLE_DEPRECATED