Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. [RequireComponent(typeof(Rigidbody))]
  6. public class PlayerController : MonoBehaviour {
  7.  
  8. Rigidbody Rigibody;
  9. Vector3 velocity;
  10. // Use this for initialization
  11. void Start () {
  12. Rigibody.GetComponent<Rigidbody> ();
  13.  
  14. }
  15.  
  16. public void Move(Vector3 _velocity){
  17. velocity = _velocity;
  18.  
  19.  
  20.  
  21.  
  22. }
  23.  
  24. public void FixedUpdate(){
  25. Rigibody.MovePosition (Rigibody.position + velocity * Time.fixedDeltaTime);
  26.  
  27.  
  28.  
  29.  
  30.  
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement