How to freeze KinematicBody2d when a Tween is playing

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Artium Nihamkin

I have a KinematicBody2d that plays a Tween when colliding with an object and then destroys itself.

How do I stop it from moving and generating collisions during the period of time that the tween is playing? How to do it recursively for it’s children as well?

I have seen examples that use clear_shapes unfortunately KinematicBody2d does not have this function.

:bust_in_silhouette: Reply From: volzhs

I think this code would work.

kinematicBody2D_instance.collision_layer = 0
kinematicBody2D_instance.collision_mask = 0