How to make a character stop walking when hitting a wall

I tried to do the same thing you said but it came out bad. I think I did something wrong. How can I get x and y values? I’m sorry to bother you. I’m new to this. :sweat_smile: