how do I make is_on_Wall ignore some walls

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

Create an enemy that changes direction when it collides with a wall, but I don’t want that to happen shock with a player

if is_on_wall():
		direccion.x = 1 if direccion.x == -1 else -1
		$Spr.flip_h = false if $Spr.flip_h == true else true
:bust_in_silhouette: Reply From: TheNewGrant

I had a similar question when I was trying to make falling objects disappear instead of bouncing off the player when colliding. My solution was to put an Area2D inside of my “player” KinematicBody2D parent node with an Area2D collision slightly bigger than the KinematicBody2D collision. The Area2D collision boxes can behave differently than the KinematicBody2D/StaticBody2D/RigidBody2D ones in which it won’t make them bounce back and you can detect what is colliding or entering the collision shape to make a something happen (disappear, shock, damage, etc). I recommend that you try using an Area2D with a CollisionShape2d as the child on your enemy character, and then connecting the area_entered() signal to your player character, to have damage or what ever you want to happen to either or both of them.