drdelta

Dr Delta

Feb 20th, 2010
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class NewBehaviourScript : MonoBehaviour {
  5.  
  6.     void Awake() {
  7.         //print( "Waking Up" );
  8.     }
  9.    
  10.     // Use this for initialization
  11.     void Start () {
  12.         //print( "Hello World" );
  13.     }
  14.    
  15.     // Update is called once per frame
  16.     void Update () {
  17.         //print( "Hello Again" );
  18.         transform.Translate(new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical") ) * Time.deltaTime * 10, Space.World);
  19.         if (Input.GetAxis("Jump") > 0) {
  20.             rigidbody.AddForce(Vector3.up * Time.deltaTime * 1000);
  21.         }
  22.     }
  23.    
  24.     void LateUpdate() {
  25.         //print( "Sorry I'm Late" );
  26.     }
  27.    
  28.     void OnCollisionEnter( Collision collisionInfo ) {
  29.         foreach( ContactPoint contact  in collisionInfo ) {
  30.             print( "Hit: "+contact.otherCollider.gameObject.name );
  31.         }
  32.     }
  33. }
Add Comment
Please, Sign In to add comment