Fix physical bone is not animated in running project.
This commit is contained in:
parent
4366f8bcd4
commit
da7eb96804
|
@ -326,13 +326,11 @@ void Skeleton3D::_notification(int p_what) {
|
||||||
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
|
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
|
||||||
// This is active only if the skeleton animates the physical bones
|
// This is active only if the skeleton animates the physical bones
|
||||||
// and the state of the bone is not active.
|
// and the state of the bone is not active.
|
||||||
if (Engine::get_singleton()->is_editor_hint()) {
|
if (animate_physical_bones) {
|
||||||
if (animate_physical_bones) {
|
for (int i = 0; i < bones.size(); i += 1) {
|
||||||
for (int i = 0; i < bones.size(); i += 1) {
|
if (bones[i].physical_bone) {
|
||||||
if (bones[i].physical_bone) {
|
if (bones[i].physical_bone->is_simulating_physics() == false) {
|
||||||
if (bones[i].physical_bone->is_simulating_physics() == false) {
|
bones[i].physical_bone->reset_to_rest_position();
|
||||||
bones[i].physical_bone->reset_to_rest_position();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue