How to set and change enemy path in real time in game ?

Hello guys ,I have added the script to a cube which is my enemy object such that it will move over certain waypoints in a loop. The way points are set at 4 corners of square.

Now according to my game the player object (a different cube) can push other objects in scene other that the enemy cube. So I want that when player puts a object in the path of enemy , enemy should go around that object to next waypoint or turnaround to find the the path to reach to next way point.

Hope this make sense . I am at beginner level right now so I am in need of your help. On this logic only my whole game is based.

Thank you.

This is called path finding, and I wouldnt exactly call this something of the beginner level - if you are the one who will code this. The solutions that are offered also arent the cheapest ones. Alternatively you can try playing around with raycasts. Should you have the time I would recommend looking up the A* Algorytm. Note that one linked in the asset store is one that was optimized to unity.

Programming pathfinding is not beginner level.