I'm new to Godots physics engine; I wanted to make a game where everytime the player touches the screen the playerNode(a RigidBody2D) behaves like a StaticBody2D, otherwise the node should behave like a RigidBody2D.
My Code below doesn't work. When the screen gets touched the playerNode behaves like a StaticBody2D, but if I stop touching it doesn't change back to the RIGID_MODE-Behavior.
However, I can see in the console that the value of "mode" changes as wanted, but still theres no gravity or so that gets applied.
mode = MODE_STATIC
mode = MODE_RIGID
What makes it even more confusing is that if I switch mode = MODESTATIC and mode = MODERIGID it works, but not the other way around.