+2 votes

In my project I have a spell attack that uses an Area2D as the root node. I can detect when it enters kinematic bodies without problem so it can dissipate and affect players/enemies.

However, I have a TileMap that I am using to draw levels with floor and walls. The player and enemies collide with the walls, but I am struggling to find out how to make the spell dissipate upon touching the walls. I don't want them to be able to go through walls.

Can I do this, or do I have to make the attacks use a kinematic body? The only problem with that is they physically interact with other bodies they collide with when I don't want them to.

in Engine by (26 points)

Area2D's body_entered signal will fire on TileMaps too. Share more about your implementation and maybe we can see why it's not working for you.

You are right, it works now- the problem was that the script was checking if the colliding body was an enemy and not considering tiles at all. I've changed it to collide with all bodies that aren't the player.

Now try to find the tile cell that collided though...

Detecting the tile you collided with is very easy:

Please log in or register to answer this question.

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.