Hey. So, i have a gameobject CameraRig with a Script CameraControl.cs and a Game.cs Script
in the CameraRig is this variable:
public GameObject[] m_Spawnpoints;
and i want to put in my Game.cs the var
public GameObject Spawnpoint1;
for this i wanted get the first Element of the m_Spawnpoints List from the CameraRig list like this:
GameObject.Find("CameraRig").GetComponent<CameraControl>().m_Spawnpoints[1] = Spawnpoint1;
and put it in the Spawnpoint1
. but the Script above doesent work, why?
this seams to be also wrong
Spawnpoint1 = GameObject.Find("CameraRig").GetComponent<CameraControl>().m_Spawnpoints[1]:
thanks!