I have pick up items that are destroyed when the player picks them up, when I load the level from the gameover or start screen after playing, the objects are still destroyed and therefore the player cannot pick them up. I would like it so that the objects are instantiated from a prefab when the level is reloaded. Here is my current script:
using UnityEngine;
using System.Collections;
public class objectregen : MonoBehaviour {
public GameObject original;
public GameObject prefab;
void Start(){
if (!original) {
print("stuff");
Instantiate(prefab);
}
}
}
I get no errors but nothing happens.