public class SpawnFire : MonoBehaviour
{
public bool iscreated = false;
public GameObject Smallfire;
void OnCollisionEnter (Collision col)
{
if (col.gameObject.name == "GameFire") {
Destroy (col.gameObject);
iscreated = true;
}
}
void update()
{
if (iscreated)
{
Debug.Log ("smal fire has spawned!!");
Quaternion spawnRotation = Quaternion.identity;
Vector3 spawnPosition = new Vector3 (
0, 0, -6.5f);
Instantiate (Smallfire, spawnPosition, spawnRotation);
iscreated = false;
}
}
}