0 votes

So basically I have two nodes: an Enemy node and a Player node.

The Enemy node has a collision shape, and the Player node has a collision shape for the body, as well as a collision shape for the attack.

What is currently happening is that when I enable the attack collision shapes, the collision resolutions acts as if the attack collision shape is part of the entire Player body, and when the Player approaches a solid object, instead of stopping where the Player body collision box is, it stops where the attack collision box is. But I need the attack collision box to detect when an enemy has been hit. So my question is, how do I make the game ignore the attack collision box when colliding with solid objects, but not ignore it when an enemy is being attacked.

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

2 Answers

0 votes
Best answer

Set the attack to be on its own collision_layer and the solid's mask to not interact with it.

More information here about collision_layers and masks

by (5,020 points)
selected by
0 votes

Found solution: Collision layers/masks

by (188 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 webmaster@godotengine.org with your username.