I`m a new Unity learner.Recently,a Quesetion Bother me.When I use AStar build a 2D project,I use grid graph,but when the Width and Depth value is too large,the project will become very lag,how could i fix the question

can I fix the question by changing the Grid Graph’ center following the Player’s position so that I could use smaller value of Width and Depth to satisfy the needs of nearby Enemy movement of chasing Player.And I don`t known how to use scripts invoke the Width and Depth ,I try to getComPonent(). But I cant catch this.
I am very appriciate for your help.


I’m not quite sure what you are asking. Could you try to reformulate your question?