How to access prefab object component

hi, i have an object in my frefab folder under project not hierarchy, im instantiate this object and its working perfect but i want to acces this prefab object component and change variable but its giving error NullReference, is that any way to acces prefab object component? i wont put this prefab object in my hierarchy

As soon as you add a GameObject you can store a reference to it in your script and manipulate it. For example:

GameObject myItem=(GameObject)Instantiate(Item, transform.position, transform.rotation);

Then you can manipulate myItem as your heart desire!
Hope it helped)

yes its working, thank you :slight_smile: