CopyPastehas never been so tasty!

make me move

by anonymous

  • 0
  • 0
  • 0
155 views

var speed = 10;
//the currect lavel
var nextlLavel:int;


function Update()
{
if(Input.GetKey("left"))
{
rigidbody.AddForce(Vector3.left*speed);
}


if(Input.GetKey("right"))
{
rigidbody.AddForce(Vector3.right*speed);
}
if (Input.GetKey("up"))
{
rigidbody.AddForce(Vector3(0,0,1)*speed);
}

if (Input.GetKey("down"))
{
rigidbody.AddForce(Vector3(0,0,-1)*speed);
}

}
function OnTriggerEnter (hit : Collider)
{
if (hit.tag=="enemy")
transform.position=Vector3(-1.836594,3.364676,-5.482049);
else
// trasport me into the currect lavel
Application.LoadLevel ( nextlLavel);
}

Add A Comment: