Object A instantiates Object B on KeyPress. This script is attached to Object B.
private GameObject crowd;
void Start()
{
crowd = GameObject.Find ("Crowd(Clone)");
}
void Update()
{
if (!GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerDamage>().invulnerable)
{
if (gameObject.renderer.bounds.Intersects(crowd.renderer.bounds)) {
// Do some stuff
}
}
}
- NullReferenceException: Object reference not set to an instance of an object
DestroyRadius.Update ()