I have this script that detects when the orb is touched and destroys it after activating the camera on the thing it touched it.Now the problem is that the camera isn't activating even tho it should, why?
using System;
using UnityEngine;
public class OrbTouched : MonoBehaviour
{
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.name == "Human")
{
Transform[] TableArray = GetComponentsInChildren<Transform>();
for (int i = 0;i < TableArray.Length; i++)
{
if (TableArray[i].gameObject.tag == "MainCamera")
{
TableArray[i].gameObject.SetActive(true);
//IT DESTROYS AFTER ITS DONE
Destroy(gameObject);
}
}
}
}
}