Another thing that you will need to do when dealing with AIs is that if you're using Shooter AI, when they die, they don't disappear, at least by default. This adds realism to our world, but it's still very computationally expensive to have them around. Thankfully, we can add another component to make it quite easy for us to clean up enemies of our choice.
From the Project tab, open the
MyGame/Prefabsfolder and select the
UFPS_Enemythat we created earlier.
From the Inspector tab, scroll all the way down and press the Add Component button. From here, navigate to Shooter AI | Clean Up After Death.
By default, it has the Cleanup Time property set to
10, which means that after 10 seconds it will disappear. Since we want to see it quickly, change the value to
Save your project and start the game again.