I'm trying to get my Recoil Script but I can't GetComponent.
I've tried transform.GetComponentInParent<Recoil>();
I've tried FindObjectOfType<Recoil>();
I've tried transform.parent.parent.parent.GetComponent<Recoil>();
I've tried transform.Find("Player/Camera Holder").GetComponent<Recoil>();
The error comes out the same.
NullReferenceException: Object reference not set to an instance of an object.
Any help is appreciated!
If the objects are instantiated prefabs...