Nav Agent moves with lag

Hello!
I have been looking on the Internet for that issue and haven’t found anything, so I have decided to post it here.
I’m doing a game with simple AI. When there are like 7/8 nav agents, some of them start getting lagged, like walking one step every 20 seconds (or just don’t move). The game isn’t lagged, is only the agents. I have tried everything, but I don’t find the problem. The AI gets a path to a destination and it goes there. The code I’m using is only “SetDestination”.
Any idea?
Thanks!

Hi Davidin99,

Its difficult to help without seeing your code but questions I might ask is:

Is there anything in the Profiler that might give you a hint into the cost per frame of your actions?

Are you setting a new destination every frame or just once?

Does this happen with just 1 or 2 or 4 agents?
How complex is your nav mesh?

Kind Regards,
Joe

1 Like