+1 vote

I disable physical skeleton (ragdoll) so the player won't collide with it in the scene. When my enemy dies I re-enable it. But it loses gravity and starts to float around. What is the problem?

Here's the code:

if !is_dead:
    for b in $mesh/bones/skeleton.get_children():
        if b is PhysicalBone:
            for c in b.get_children():
                if c is CollisionShape:
                    c.disabled = true
else:
    for b in $mesh/bones/skeleton.get_children():
        if b is PhysicalBone:
            for c in b.get_children():
                if c is CollisionShape:
                    c.disabled = false

if is_dead:
    for c in get_children():
        if c is CollisionShape:
            c.disabled = true

And here is the video.

I tried re-setting parameters like this (doesn't help):

b.mass = 1
b.weight = 9.8
b.gravity_scale = 1
asked Mar 29, 2019 in Engine by wowzzers (65 points)
edited Mar 30, 2019 by wowzzers

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.