2D pathfinding scripting

Several question to ask regarding pathfinding in 2D for unity
I had done pathfinding before in another language but that is my first try in pathfinding as it is an assignment given to me.

What if the pathfinding is targeting a moving object like enemy using pathfinding to find player when it is always moving?
Does it keep calling the pathfinding or like call it like after a certain time like e.g 5 sec?

I am using A*star for pathfinding but for the starting array of the map like where is the player located at e.g.(0,2),wall located at e.g.(1,1),(1,3),(3,3).Do I use like I need to set all this by my own for every map or I can use another Method?

Sorry as the first pathfinding I did had all the collsion being sorted out for me as that is an assignment but using unity is a totally different experience to me…

Raycasts are an easy way to find out what are on the map, like where is a tile walkable and not.

How often you call it depends on how fast your implementation is. Every 5 second for a moving object will be kinda silly though.

Oh,I never think of that…thanks.