Sharing ints,Camera position(MOba),warnings,Could loop a fuction in start???
So yesterday i made a question but only one guy aswer it and it wasnt quite a Answer more a advice but ive got this tree to four problem here are they in topics (Solve them in topics too) plz
So the code is in this site pastebin http://pastebin.com/35jGMRXA and in this page http://pastebin.com/639V3sec Its public so anione can check it any time... So in the code i tried to share the int like thisI cant share ints...
if(GameObject.Find("edificio").GetComponent().atacado == true){ setX = GameObject.Find ("edificio").GetComponent<vidaEdificioScratch> ().goX; setY = GameObject.Find ("edificio").GetComponent<vidaEdificioScratch> ().goY; setZ = GameObject.Find ("edificio").GetComponent<vidaEdificioScratch> ().goZ; }
but it didnt work and a wild error as appeared (XD) so it said me this
Object reference not set to an instance of an Object
I looped in the start method
my dad is an a medium programer but is always busy and it dont mess around with code like 20 years... but he telled me the start method only takes 0 frames so i think well no loops But yesterday i put in the start method intantiate(game object); and AND IT CRASHED MY PC with so many objects created...
Help in thinking???
yeah im not english but i want to make a moba camera but without depending on a character (Terrain Camera???) so i coded this
public float setX;
public float setY;
public float setZ;
//here is void start etc...
void Update () {
setX = Input.mousePosition.x;
setZ = Input.mousePosition.y;
transform.position = new Vector3 (setX, setZ, setY);
and it dindt work because i supoused the window is 1000 x500 because the floats go only to that position...
Dindt clarify enought tipe in the comments or in the aswer...