I want to make a enemy that move along a wall in my 2d game. First thing i did was check if in front of it is a wall , if true then rotate 90 degrees up. But what if before it isn’t a wall but under it like this:
And i think rotate 90 degrees isn’t the best way because sometime my enemy don’t touch the wall.