How to check if something is Inbetween two objects

I am trying to create and enemy in my game in where is will charge at the player until hitting a wall ( Its a top Down Game ). But I can find a way to make sure that there is no wall inbetween the player and it. How can it check that?
I want it to check to see if the distance between it and the player hits a wall. But I can’t figure it out. I dont want the AI to look stupid and bash into walls inbetween the player constantly.

Hi, you could use a raycast for that. Using the raycast object looks, maybe, a bit complicated but it is actually quite straightforward. Some explanation can be found in the forum, for example here [Solved] Raycast. There are other related forum topics as well and if you have difficulties we can probably help you with that.