Poor performance due to high number of game avatar

I was making a game about sieging a fort.
I made some weapons and some siege weapon and tested them on some avatar-- but when I boost up the number of avatars(about 50) the game became unplayable due to poor performance, which is about 6-7fps.
Each avatar contains a nav mesh agent, an animator and some script. I want the avatar to ragdoll after their death, so no death animation were used.
is there anything I can do to save this situation?
sry for the shitty English btw :slight_smile:

You should always profile first when asking performance questions. You’ll only really know what the problem is once you’ve run the profiler.

In general, though, the answer is going to be “do less”. You can have fewer joints in the avatar, make sure to shut down navigation and other scripts while the character is being ragdolled, etc. Also, many games have a maximum number of ragdolls, usually around 4 and fall back to animation based solutions when that number is exceeded.