im currently trying to make a script that finds the axis of certain players so i can instantiate other ones correctly. my script is this
public bool firstdimension;
public bool seconddimension;
public bool thirddimension;
public Vector3 axis;
public Vector3 xy;
private Transform player3d;
GameObject fpv3;
GameObject tpv3;
GameObject twodplayer;
// Update is called once per frame
void Update () {
Debug.Log(fpv3);
Debug.Log(tpv3);
fpv3 = GameObject.Find("firstpersonplayer");
fpv3 = GameObject.Find("firstpersonplayer(clone)");
tpv3 = GameObject.Find("thirdpersonplayer");
tpv3 = GameObject.Find("thirdpersonplayer(clone)");
twodplayer = GameObject.Find("player(clone)");
twodplayer = GameObject.Find("player");
if (thirddimension == false) {
if (fpv3 != null) {
axis = fpv3.transform.position;
}
if (tpv3 != null)
{
axis = tpv3.transform.position;
}
if (thirddimension == true)
{
xy = twodplayer.transform.position;
}
}
}
my problem is that as soon as i added the xy variable everything for axis stopped working and now i cant get any of it working again, can anyone help please?