Advertisement
szymski

Untitled

Jul 31st, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using Wow;
  4.  
  5. namespace Wow {
  6. public static class Global {
  7.     public static int wow = 10;
  8. }
  9. }
  10.  
  11. public class WASDMove : MonoBehaviour {
  12.     public float speed = 100f;
  13.    
  14.     //int rotatespeed = 1800;
  15.     void Start () {
  16.         //transform.Translate (new Vector3 (0, 10, 0));
  17.  
  18.     }
  19.  
  20.  
  21.     void FixedUpdate () {
  22.        
  23.         Rigidbody rbd = GetComponent<Rigidbody>();
  24.         float horz = Input.GetAxis ("Horizontal");
  25.         float vert = Input.GetAxis ("Vertical");
  26.         rbd.AddForce (horz * speed * Time.fixedDeltaTime,0.0f, vert * speed * Time.fixedDeltaTime);
  27.  
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement