how can i enable and disable collisions from script

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

how can i enable and disable collisions from script

:bust_in_silhouette: Reply From: njamster

By getting the nodes CollisionShape2D and setting its disabled-property accordingly:

get_node("CollisionShape2D").disabled = true    # disable
get_node("CollisionShape2D").disabled = false   # enable

If you only want to disable collisions with certain but not all objects, take a look at collisions layers and masks.

thank u so much i love yaaaaaaa

ManiCus | 2020-02-11 16:56