I am trying to instantiate my fire particle system during runtime like this:
GameObject fire, firePrefab;
void Start()
{
...
firePrefab = Resources.Load("FirePrefab") as GameObject;
}
void FixedUpdate()
{
if (Input.GetKeyDown(KeyCode.V))
{
fire = Instantiate(firePrefab, transform.GetChild(3).position, transform.GetChild(3).rotation);
Destroy(fire, 5.0f);
}
}
My FirePrefab is just a regular particle system, and the model the above script is attached to looks like this:
Model
Default
Camera
DroneFire
However, my fire prefab isn't instantiated anywhere when I run the game.