In the video you comment and said you can’t do a rename on the string. The problem is you are actually using a magic string. The same string in two places. You should be looking at the same object. It should look like below.
- Then you could possibly make it public and control that object in your designer.
- You could change the string as you like.
- You could move it to a class so other places reference the same string, to protect against typos
private string PARENTOBJECT= “Defenders”;
private GameObject parent;
private Camera myCamera;
void Start()
{
myCamera = GameObject.FindObjectOfType<Camera>();
parent = GameObject.Find(PARENTOBJECT);
if(!parent)
{
parent = new GameObject(PARENTOBJECT);
}
}