0 votes

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"

Godot version 3.3.3.stable.mono
in Engine by (177 points)

1 Answer

0 votes
Best answer

SOLVED:

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

by (177 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.