Hi,
I am new to scripting and I am trying to make a script but am a little stuck
I am working on a script that says if currentWaypoint is equal to 0 then target should have position of Waypoint_0.
Hi,
I am new to scripting and I am trying to make a script but am a little stuck
I am working on a script that says if currentWaypoint is equal to 0 then target should have position of Waypoint_0.
Download a few or the tutorials as they are full of script examples. Or you can just look in the scripting manual for some quick exampls of vector 3 and transform.position.
var cW_0A : int;//Less characters means faster. lol
var gObj_0A : Transform;//Assign some Gobjects to control/read
var gObj_1A : Transform;
//-----------------------------------------------------------------------------//
function Update() {
if(cW_0A==0) {// == Means equal , = Means assign
gObj_0A.position.y = gObj_1A.position.y;
}
//Another example
if(gObj_0A.position.y==gObj_1A.position.y) {
gObj_0A.position.x = gObj_1A.position.x;
}
//Another example
if((cW_0A==1)(gObj_0A.position.y==gObj_1A.position.y)) {
gObj_0A.position.z = gObj_1A.position.z;
}
else if(cW_0A==2) {
gObj_0A.position.z = gObj_1A.position.z + 10;
}
}