Ryan_3D
1
Instantiate(TheBullet, hit.point, Quaternion.FromToRotation(Vector3.up, hit.normal));
GameObject obj = (GameObject)Instantiate(TheBullet); // I am trying to create refference to the gameobject that was initiated
obj.SetActive(false);
So, this script is about bullet hole. How can i access that initiated gameobject? I need to know how to destroy it and how to disable it. Thank you for your time.
Hmm… Maybe try using obj.enabled = false instead of obj.SetActive?
Ryan_3D
3
Noo… that’s not the problem. The problem is that i can’t make reference to the initiated object itself. I just need to know how to type the following line of code.
GameObject obj = (GameObject)Instantiate(TheBullet);