0 votes

I have a Player node and Enemy node, and Player has an attack function

When the Player isattacking flag is set to true, the game checks for collisions with Enemy nodes and acts accordingly. Currently the way I detect collision is using bodyentered signal, but this doesn't work well for my case, because the attack's collisionshape will most likely already be colliding with the enemy when the attack function is called. So what I wanted to know, if there is some way to check for collision between two nodes, that is already occuring, as opposed to only when the body first enters the collision.

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

1 Answer

0 votes
Best answer

Solution: I used the function getoverlappingbodies()

by (193 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 Frequently asked questions and 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 [email protected] with your username.