summaryrefslogtreecommitdiff
path: root/servers/physics_2d/body_2d_sw.cpp
diff options
context:
space:
mode:
authorMarcel Admiraal <madmiraal@users.noreply.github.com>2019-10-14 16:19:15 +0200
committerMarcel Admiraal <madmiraal@users.noreply.github.com>2019-10-15 07:41:13 +0200
commit13798746e7fb236930711e8c6a36fe55bcde6e5d (patch)
tree8e38216f6ba5c17bbd86e02bd80e1d1fb9c62094 /servers/physics_2d/body_2d_sw.cpp
parent1fed266bf5452b30376db62495f4985f6975f2c1 (diff)
Activate Body(2D)SW when switching to rigid or character mode.
Diffstat (limited to 'servers/physics_2d/body_2d_sw.cpp')
-rw-r--r--servers/physics_2d/body_2d_sw.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp
index f9939e3843..de1dfc9ee7 100644
--- a/servers/physics_2d/body_2d_sw.cpp
+++ b/servers/physics_2d/body_2d_sw.cpp
@@ -238,6 +238,7 @@ void Body2DSW::set_mode(Physics2DServer::BodyMode p_mode) {
_inv_mass = mass > 0 ? (1.0 / mass) : 0;
_inv_inertia = inertia > 0 ? (1.0 / inertia) : 0;
_set_static(false);
+ set_active(true);
} break;
case Physics2DServer::BODY_MODE_CHARACTER: {
@@ -245,6 +246,7 @@ void Body2DSW::set_mode(Physics2DServer::BodyMode p_mode) {
_inv_mass = mass > 0 ? (1.0 / mass) : 0;
_inv_inertia = 0;
_set_static(false);
+ set_active(true);
angular_velocity = 0;
} break;
}