Collision detection working in one node, but not in the other with identical code?

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

This is my code, for both nodes(Spike and Flamethrower), it is exactly the same:

func _process(delta):
var colBodies = get_overlapping_bodies()
for i in range(0, colBodies.size()):
	if("type" in colBodies[i]):
		if(colBodies[i].type == "Player" && is_active):
			print("DID COLLIDE")
			colBodies[i].dealDamage(damage, position)

The is active variable returns true, and the same exact code works for the Spike node, but doesn’t work for the Flamethrower

Console doesn’t print “DID COLLIDE”

:bust_in_silhouette: Reply From: JorensM

SOLVED:

Ooooops, turns out I had my collision layers and masks set up wrong!