Good evening! As you can see in the following script. I am trying to only execute the trigger enter if it is in a certain time. First time when I referenced the sword object from the inspector it went well, but since when I made a prefab from the sword object it can't access the script on the sword. Code (CSharp): using System.Collections; using System.Collections.Generic; using UnityEngine; public class collision : MonoBehaviour { public GameObject sword; private void OnTriggerEnter(Collider collider) { float slashtime = sword.GetComponent<movement>().slashtime; Debug.Log(sword ); Debug.Log(slashtime); if (collider.tag == "sword" && slashtime+1f > Time.time) { Destroy(gameObject); } } } I would be really thankful for any help.