Hello guys, I’m using this code to spam my arrows skill, it’s about 10 arrows at the same time and it make FPS drop down a lot. Do you have any solution for this? thank you!
IEnumerator delaySkill(){
m_anim.Play("Skill1");
yield return onesecond;
for (int i = 0; i < m_Skill1SpawnPoints.Length; i++) {
GameObject newArrow = Instantiate (arrow) as GameObject;
newArrow = Instantiate (arrow, m_Skill1SpawnPoints [i].transform.position, Quaternion.identity);
newArrow.transform.position = m_Skill1SpawnPoints [i].transform.position;
Rigidbody rb = newArrow.GetComponent<Rigidbody> ();
rb.velocity = m_Skill1SpawnPoints [i].transform.forward * arrowspeed;
}
m_anim.SetBool("IsIdle",true);
attack = true;
SkillReady = true;
yield return new WaitForSeconds(SkillDelay);
SkillReady_1 = true;
}