please give me your suggestions about the performance issue I have.
In order to let our creature find a path in a direction the creature faces, I place a U-shaped blocker around the creature’s position by instantiating a prefab with a collision. Then I update A* with
Once the path is calculated, I remove the blocker out of the navmesh. I do cache flush requests, so I update astar once per frame, not once per creature (I have 16 of them on a map).
Everything works fine on a PC, but on a Switch we have periodical framerate drops every 10 or 15 seconds of a gameplay, which is very annoying. Profiler gives following timings:
Seems like PerformBlockingActions is the main reason. It seems like it is happening because of that blocker placement. Are there any ways to fix this issue?
Unity 2018.4.24, Astar pathfinding project 4.2.8 (according to changelog), Pro version. I use Recast navimesh, 512x512 in size.
Best regards, Artem.