+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
in Engine by (78 points)
edited by

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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.