From 967854f8e94b1070ae3e283f654e3c8a3c14bd65 Mon Sep 17 00:00:00 2001
From: AndreaCatania <info@andreacatania.com>
Date: Tue, 21 Nov 2017 18:31:43 +0100
Subject: [PATCH] Set gravity on change body mode  Fixes #13140

---
 modules/bullet/rigid_body_bullet.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp
index 98ae82bc5fc..f5ab8221e3e 100644
--- a/modules/bullet/rigid_body_bullet.cpp
+++ b/modules/bullet/rigid_body_bullet.cpp
@@ -511,12 +511,14 @@ void RigidBodyBullet::set_mode(PhysicsServer::BodyMode p_mode) {
 			mode = PhysicsServer::BODY_MODE_RIGID;
 			set_axis_lock(axis_lock); // Reload axis lock
 			_internal_set_mass(0 == mass ? 1 : mass);
+			scratch_space_override_modificator();
 			break;
 		}
 		case PhysicsServer::BODY_MODE_CHARACTER: {
 			mode = PhysicsServer::BODY_MODE_CHARACTER;
 			set_axis_lock(axis_lock); // Reload axis lock
 			_internal_set_mass(0 == mass ? 1 : mass);
+			scratch_space_override_modificator();
 			break;
 		}
 	}