So, I am trying to make RigidBody2D behave like StaticBody after some event. For this purpose I use this code:
func _on_Bullet_body_entered(_body: Node) -> void:
sleeping = true
mode = MODE_STATIC
The problem happens when KinematicBody2D collides that node. It starts to behave like RigidBody2D again.
But if I set
mode using godot interface it works perfectly, exactly how I need.
What am I doing wrong?
The left ball set static by code, the right one set static from interface
Also, the engine thinks that the object is static: