–1 vote

I have 3 collision mask layers: ground, enemy and player.

The enemy should collide both with the ground and the player.

I also want the enemy to move along a platform and turn around once it detects the edge of the platform. For this i'm using test_move().

The problem is that the enemy cant distinguish between the ground and the player. A player can fool the enemy into thinking they are a part of the platform. And so, my enemies platform edge detection sometimes fails.


How can i distinguish between collision layers or objects or anything? test_move seems to be object-blind.

Godot version 3.2.3
in Engine by (11 points)

1 Answer

0 votes

You can use a separate Area, which only collides with the player.
If you still need the primary collisions to hapen with the player, you can make the Area slightly bigger than the enemy.

by (2,482 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.