test_move to test against a collision mask

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By PotatoPro

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.

Image:

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

:bust_in_silhouette: Reply From: Lopy

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.