The Godot Community Forums are back up and running! Please read the the announcement post for important information on what happened. Thanks!

Ridgid bodies become immovable objects :'(

MeshuggenerMeshuggener Posts: 6Member

I keep having an issue with rigid bodied were at a random point shortly after I have started my game it gets harder and harder to push for example a door around until it just becomes impossible. It's almost like the rigid body just keeps accelerating downwards until it ends up having so much inertia that my puny pill character has no chance of moving it. Any o' yall ever experienced anything like that? If so, or if you have any ideas about how to fix this issue or any questions about what could be causing it, plz let me know :)

Best Answer

  • TwistedTwiglegTwistedTwigleg Posts: 3,129
    Accepted Answer

    It may be that the RigidBody falls asleep, and then it cannot move. Have you tried disabling the can_sleep property? I remember having an issue similar to this in a VR tutorial I made, and to fix it I had to make an Area node that wakes RigidBody nodes when they are close to the player, and then allows them to sleep when out of range.

Answers

  • MegalomaniakMegalomaniak Posts: 2,908Admin

    How have you implemented gravity?

  • MeshuggenerMeshuggener Posts: 6Member

    I mean the ridig bodies seam to just have it on their own, but for my character i have this going on I found it in a tutorial so i only really like half understand it but i guess I really just add a some velocity down every second and add it to my current y velocity so that i don't get the "accelerating down while standing on the ground" thing. Still i have a suspetion that i somehow have to toggle something somewhere or something that makes it so that the rigidbody i am having problems with (not my character to be clear) that makes it so that even though its not technically touching the ground, it still should not build accelerate downwards. I just don't have any idea where to even begin looking for that. To be clear though i am not sure that what i think is the root couse of the problem actually is the problem, it's just that it is a problem i have seen before and i can imagine that it could be a possible explination, if the object get effected by a gravitational force that is ever increasing that friction would make it slowly become harder and harder to move the object until my character simply didn't have enough strenght to move it. It goes away if i turn on "infinate inertia" but that comes with it's own slew of problems too.

  • MeshuggenerMeshuggener Posts: 6Member

    I just found a fancy little button on the rigid body called "Custom Integrator" that seems to have solved the issue when it comes to my doors at least. I am still gonna have to try out a couple of things with just regular physics objects before I mark this discussion as solves

  • TwistedTwiglegTwistedTwigleg Posts: 3,129Admin

    (I changed this discussion to a question so the answer, when found, can be marked accordingly :smile: )

  • MegalomaniakMegalomaniak Posts: 2,908Admin
    edited August 25

    You are just adding gravity without any limit to the y velocity. That might have something to do with it.

    In truth gravity is a acceleration towards a mass, and in our planets case if you were to jump off of a plane when skydiving you would experience this acceleration to a limit.

    Since there's the atmosphere cushioning you and offering friction you would only accelerate up to what is known as the terminal velocity. A point past which you wouldn't accelerate any further.

    The ever increasing gravity induced acceleration would also likely mean ever increasing friction against any floor, no?

  • MeshuggenerMeshuggener Posts: 6Member

    The code I sent is for my player, who is not the problem. I just uploaded it because I was a little unsure about what you meant, and it was the only place I had applied any gravity myself. (though for the record I am adding a velocity every second to what my current velocity in the y-direction is so if I'm on the floor not moving my downwards velocity should remain constant) My issue comes (I guess) with the default gravity there is in rigid bodies. Sometimes when I use my KinematicBody to walk into the RigidBody it simply will not be able to move. Also, I have becomes less and less sure that it has anything to do with the RigidBody's inertia and it might instead be an issue that is beyond what I am currently wise enough to comprehend.

  • TwistedTwiglegTwistedTwigleg Posts: 3,129Admin
    Accepted Answer

    It may be that the RigidBody falls asleep, and then it cannot move. Have you tried disabling the can_sleep property? I remember having an issue similar to this in a VR tutorial I made, and to fix it I had to make an Area node that wakes RigidBody nodes when they are close to the player, and then allows them to sleep when out of range.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file