1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Transform CSGShape collision when necessary

(cherry picked from commit fc8574fbac)
This commit is contained in:
hoontee
2020-08-01 01:41:10 -05:00
committed by Rémi Verschelde
parent 8ce88d38f2
commit aa0221f0fb

View File

@@ -517,6 +517,12 @@ void CSGShape::_notification(int p_what) {
_make_dirty(); _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 (p_what == NOTIFICATION_LOCAL_TRANSFORM_CHANGED) {
if (parent) { if (parent) {