- Home /
NavMeshAgent setdestination every frame?
So from what I gather and have read, setting a nav mesh agents destination every frame is bad because it has to recalculate the path each time. However through testing, using "pathPending" which returns false whilst the path is being calculated, I have found that it doesn't appear to recalculate the path every frame even though I'm setting its destination every frame. The way I imagine it works is that if the destination is different to the current destination then it would recalculate the path, whereas I'm setting it to the same point each frame. The reason I think this is because if an enemy is chasing a player, then the enemy's destination would need to be updated constantly. Just need some clarity on this really.
Old unanswered topic, but still just as relevant today. Anyone got some tips?
It may be a poorly articulated question, but the title is a question by itself. Upon reading through the text it seems, like myself, NoUJoe needs help to understand if it is indeed bad to SetDestination every frame or not. In my case this is highly relevant when having hundreds of transforms chasing a player in a complex Nav$$anonymous$$esh. Thanks for your reply though.
So you want to know this, because you are worried about fps or something like this? I am in a scimilar situation, i have tens of transforms moving everywhere with customized AI (possibly) each frame. You should ask it yourself, as far as i know you can't talk with Unity's "personnal"
Your answer
Follow this Question
Related Questions
how can I set the destination of the nav mesh for multiple objects 2 Answers
OffMesh Link and NavMesh Obstacle 1 Answer
How to queue NavMeshAgents on entering a tile in Unity (based on path distance to tile)? 0 Answers
NavMeshAgent Move towardes the final point in the path directly 0 Answers
Is there a built in notification when Nav Mesh Agents when destination is reached? 1 Answer