void SpawnChaff()
{
//Local offset
Vector3 localOffset = new Vector3 (0, 5, -18);
Vector3 worldOffest = m_trans.rotation * localOffset;
Vector3 spawnPos = m_trans.position + worldOffest;
//Loop and find the first non active Chaff
for (int i = 0; i < chaff.Count; i++)
{
if (!chaff[i].activeInHierarchy)
{
// Rumble the controller
InputManager.SetControllerVibrate(gameObject.tag, 0.3f, 0.3f, 0.2f, false);
// Go on cooldown
chaffCooldown = powerUpCooldown;
chaff[i].transform.position = spawnPos;
chaff[i].transform.rotation = m_trans.rotation;
chaff[i].SetActive(true);
//Dont forget t break loop
break;
}
}
}