summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorhoontee <5272529+hoontee@users.noreply.github.com>2020-08-01 01:41:10 -0500
committerhoontee <5272529+hoontee@users.noreply.github.com>2020-08-01 01:45:22 -0500
commitfc8574fbac1073f4d68197dc8a2b3504bfc8970d (patch)
tree2dc26f670a924a4ee3fccddd06dd328840db9498 /modules
parent227494be59eca4f50604a9c90c3c36ed15e7ecc5 (diff)
Transform CSGShape collision when necessary
Diffstat (limited to 'modules')
-rw-r--r--modules/csg/csg_shape.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index cea006364f..6d99392485 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -511,6 +511,12 @@ void CSGShape3D::_notification(int p_what) {
_make_dirty();
}
+ if (p_what == NOTIFICATION_TRANSFORM_CHANGED) {
+ if (use_collision && is_root_shape() && root_collision_instance.is_valid()) {
+ PhysicsServer3D::get_singleton()->body_set_state(root_collision_instance, PhysicsServer3D::BODY_STATE_TRANSFORM, get_global_transform());
+ }
+ }
+
if (p_what == NOTIFICATION_LOCAL_TRANSFORM_CHANGED) {
if (parent) {
parent->_make_dirty();