Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- function Update () {
- var horizontal : float = Input.GetAxis("Horizontal");
- var vertical : float = Input.GetAxis("Vertical");
- var speed : float = 3;
- rigidbody.AddForce(Vector3(horizontal*speed,0,vertical*speed));
- }
- function onTriggerEnter(other: Collider)
- {
- if(gameObject.tag == "Collectable")
- Destroy(other.gameObject);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement