Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- [RequireComponent(typeof(Rigidbody))]
- public class PlayerController : MonoBehaviour {
- Rigidbody Rigibody;
- Vector3 velocity;
- // Use this for initialization
- void Start () {
- Rigibody.GetComponent<Rigidbody> ();
- }
- public void Move(Vector3 _velocity){
- velocity = _velocity;
- }
- public void FixedUpdate(){
- Rigibody.MovePosition (Rigibody.position + velocity * Time.fixedDeltaTime);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement