September 2010
Beginner
384 pages
8h 49m
English
Let's get that function set up in the EnemyShip Script first. Double-click to open the EnemyShip Script, and get typing.
function ResetPosition(){
transform.position.y = 71;
transform.position.x = Random.Range(-11, 68);
transform.position.z = 0;
rigidbody.velocity = Vector3.zero;
}
These are the very same repositioning lines we already have. You can even just type the shell of the function, and copy/paste those lines right in there. Either way, you need to go back and eradicate those lines from the Update function and replace them with a ResetPosition() function call.
if(transform.position.y < -4) { ...Read now
Unlock full access