i want my player to be able to just go through a block like there is no collision but enemies cant and would just act like there is a collision there also i used this code to make my slime change direction
motion.x = speed * dir
move_and_slide(motion,Vector2.UP)
$AnimationPlayer.play("Slide")
if is_on_wall():
dir *= -1
$Sprite.flip_h = !$Sprite.flip_h
if is_on_floor() == false:
motion.y += gravity
or if there is a way for my slime enemy to go the opposite direction if they see there is an edge and they are gonna fall off if they dont go the opposite direction