summaryrefslogtreecommitdiff
path: root/scene/3d/skeleton_3d.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-06-19 09:25:46 +0200
committerGitHub <noreply@github.com>2022-06-19 09:25:46 +0200
commit01efb938424c7678f5a834e25244d4ed741c563a (patch)
tree041bffbe7affea5e1a1f9c91322bd818a83476b2 /scene/3d/skeleton_3d.cpp
parentb6191261a1534a7e10e7afff0d23f5a52c170e61 (diff)
parentda7eb96804b9fe008f572efc45f6e7a37842d98f (diff)
Merge pull request #62195 from hakuhan/fix-animate-physical-bone-not-working-bug
Fix physical bone is not animated in running project.
Diffstat (limited to 'scene/3d/skeleton_3d.cpp')
-rw-r--r--scene/3d/skeleton_3d.cpp12
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();
}
}
}