Skip to content

Commit

Permalink
Transform CSGShape collision when necessary
Browse files Browse the repository at this point in the history
(cherry picked from commit fc8574f)
  • Loading branch information
hoontee authored and akien-mga committed Sep 24, 2020
1 parent 8ce88d3 commit aa0221f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/csg/csg_shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,12 @@ void CSGShape::_notification(int p_what) {
_make_dirty();
}

if (p_what == NOTIFICATION_TRANSFORM_CHANGED) {
if (use_collision && is_root_shape() && root_collision_instance.is_valid()) {
PhysicsServer::get_singleton()->body_set_state(root_collision_instance, PhysicsServer::BODY_STATE_TRANSFORM, get_global_transform());
}
}

if (p_what == NOTIFICATION_LOCAL_TRANSFORM_CHANGED) {

if (parent) {
Expand Down

0 comments on commit aa0221f

Please sign in to comment.