浏览代码

Fix AnimatableBody3D not being movable in editor

aXu-AP 2 年之前
父节点
当前提交
fab6065e35
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      scene/3d/physics_body_3d.cpp

+ 5 - 0
scene/3d/physics_body_3d.cpp

@@ -333,6 +333,11 @@ void AnimatableBody3D::_body_state_changed(PhysicsDirectBodyState3D *p_state) {
 }
 
 void AnimatableBody3D::_notification(int p_what) {
+#ifdef TOOLS_ENABLED
+	if (Engine::get_singleton()->is_editor_hint()) {
+		return;
+	}
+#endif
 	switch (p_what) {
 		case NOTIFICATION_ENTER_TREE: {
 			last_valid_transform = get_global_transform();