Unity Script var teach code

Ok the Basics well here you go.
The number one thing I think in Unity script is Variables A.K.A var.
Ok here you go fallow these steps.
Step 1
Open unity and then create a Unity SCRIPT call it test1 Make sure there is no spaces.
Ok now open it.
Step 2
Ok on top of Function Start () {

}
And function Update () {

}
Click on top of the first function and right under Pragma strict
Do not care if I spelt that right.
Step 3
Ok now type var all lower case.
this is telling Unity that this line is going to be a variable which will allow you
to select what you want the var to be.
EXAMPLE:
Lets say you have a player. Player 1 ok now in the script you have to tell who the player is.
This var will tell what the object is.
step 4
ok now after typing var
put a space then type what ever you want the object to be named.
EXAMPLE:

 var player

NOTE: do not put spaces between the letters after the var
EXAMPLE:

 var p l a y e r

NOTE: that will not work.
step 5
ok now put a : symbol remember the sembol looks like this :
EXAMPLE:

 var player :

step 6
Ok now put what you want the player or what ever you want the var to be.
But this time lets put it as a GameObject.
EXAMPLE:

 var player : GameObject;

make sure you spell GameObject as I spelt it.
The G has to be capital and the O has to be capital.
Also remeber to put this symbol at the end ;
this symbol tells that this line is done A.K.A it excutes it.
ok now sense now thats done save your script and Mini-Mize the Mono Developement program.
ok now make a cube in your scene and then click on it then attach the script to the cube
and then click on the cube again and look to the right were it shows the cube and every thing
look at your script and the var you put is blank well now you can click on the little circle next to it and then you may pick what you want the GameObject to be.
Here are a list of things that can be made var’s. when you see yourput that means what ever you want to put in there just remember no spaces.

var yourput : GameObject;
var yourput : float;
var yourput : Transform;
var yourput : RigiBody;
var yourput : Int;

Just remember your var can be any thing with in unity3d.
Now the next step….
Codes for variables.
Float = Is a number of some type of variable.
Int = Is the same as float but can be used to save progress.
GameObject = A GameObject that may be in your assist or your scene.
Transform = Its like a GameObject but can only be selected in your scene.
RigiBody = Like a GameObject but it = up to a part of the GameObject.
And there’s many other things you can make your Variable but you need to find out the codes first.
Ok now lets make are own time limit by making vars.
Ok the same as last time put the var on top of any function.
Just make sure its not in these lines {}
EXAMPLE:

Function Update () {
Var player : GameObject;

}
It needs to be on top of a function.
Ok now lets make are timer
Type this.
[CODE]
var timestart : float = 1;
var timeend : float = 10;

Ok now in the function Update put this code in these lines {

}
EXAMPLE:

function Update () { ++timestart;


}

This means in this Update on every frame it will change the number to the variable.
Ok now lets make it to where if the timer gets to a limit it will stop.
Type this.

function Update () { ++timestart;
if( timestart = 5) timestart == 5;

}

Now where there’s two == signs there might only need to be one but
First try two…
Ok now attach the script to a GameObject then click play.
Then switch back to your scene then click on the GameObject with the script then look to the right and see the script and the timer will be going up or it already reached its limit.
Well that’s it fow variables for now.

While I appreciate the effort, there are a number of errors/typos here. I’d strongly recommend that you be 100% sure of everything you write for a tutorial before posting it (and test it all several times just in case), because it’s not going to do beginners any good to encounter errors they wouldn’t know how to fix yet. For example, you really can’t write things like “Now where there’s two == signs there might only need to be one but First try two…” because that’s fundamentally wrong. You should understand the basics of programming before attempting to teach others please.

–Eric

I’ll say he needs to learn to spell correctly, before creating tutorials.