|Topic was automatically imported from the old Question2Answer platform.
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:
MODE_STATIC? Is it a variable you defined yourself? Can you try using
exuin | 2021-05-22 15:58
It is a constant from
RigidBody2D. I have just updated the code in my post to make it clear.
Can you try using
Yeah, I tried this one too. The result was the same.
atmeo | 2021-05-23 07:18