AI Enemy Collision

Can you help me?
How to add a collision to the “enemy” so that when you touch anything he stops (just not to penetrate through walls)
So just watch this video: - YouTube
How can i fix this?
I can’t find solution.
Greetings! :D
Here screenshots:


If you are using paper 2D, sprites should not collide through walls.
Are you sure the environment and AI sprite is on the same layer?