CopyPastehas never been so tasty!

dwfw

by anonymous

  • 0
  • 0
  • 0
167 views

var speed = 17;
//the currect lavel
var nextlLavel:int;
var moveDir = Vector3.zero;
var coin=0

function FixedUpdate()
{
moveDir.x = Input.GetAxis("Horizontal") * speed;
moveDir.z = Input.GetAxis("Vertical") * speed;

rigidbody.AddForce( moveDir);

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


Add A Comment: