Trying to make a KinematicBody2D pass threw a tileset using set_collision_mask_bit()

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

Context: When a Player dies they have a short amount of time that allows them to pass threw a tileset. I made a prototype of this system for when I use the (E) key it deactivates a mask that the tileset uses, while the print() function seems to be working the player won’t pass threw the wall.

What did I do wrong?

func ghost():
if is_dead == false:
	set_collision_mask_bit( 2, false )
	print("I am dead!")
	is_dead = true
else:
	set_collision_mask_bit( 2, true )
	print("I am alive!")
	is_dead = false