diff options
author | baihan <bh198@hotmail.com> | 2022-06-19 09:46:34 +0800 |
---|---|---|
committer | baihan <bh198@hotmail.com> | 2022-06-19 09:46:34 +0800 |
commit | da7eb96804b9fe008f572efc45f6e7a37842d98f (patch) | |
tree | c408e7b84d124a1d9d3014e9b7a8a3055c4dec86 /scene/3d | |
parent | 4366f8bcd455714a5cd29374726d83b674ff0430 (diff) |
Fix physical bone is not animated in running project.
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/skeleton_3d.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp index ba2029788e..fbd5f31dd5 100644 --- a/scene/3d/skeleton_3d.cpp +++ b/scene/3d/skeleton_3d.cpp @@ -326,13 +326,11 @@ void Skeleton3D::_notification(int p_what) { case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { // This is active only if the skeleton animates the physical bones // and the state of the bone is not active. - if (Engine::get_singleton()->is_editor_hint()) { - if (animate_physical_bones) { - for (int i = 0; i < bones.size(); i += 1) { - if (bones[i].physical_bone) { - if (bones[i].physical_bone->is_simulating_physics() == false) { - bones[i].physical_bone->reset_to_rest_position(); - } + if (animate_physical_bones) { + for (int i = 0; i < bones.size(); i += 1) { + if (bones[i].physical_bone) { + if (bones[i].physical_bone->is_simulating_physics() == false) { + bones[i].physical_bone->reset_to_rest_position(); } } } |