how to make the enemy "KinematicBody2D" ignore the player "As wall", when using is_on_wall

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

Use is_on_wall to detect when an enemy collides with a wall, to change its direction. But I don’t want this to happen with the player, I want him to ignore this when he collides with the player to keep looking at the direction of this

:bust_in_silhouette: Reply From: Magso

The easiest way would be to put them on different collision layers for e.g.
Walls on layer 1, Player on 1 & 2 and Enemy on 1 & 3.
The enemy can then have an area set to layer 2/the player’s layer for any interaction.