Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Rigidbody rb;
- private float movementX;
- private float movementY;
- // Use this for initialization
- void Start () {
- rb = GetComponent<Rigidbody>();
- }
- void OnMove(InputValue movementValue)
- {
- Vector2 movementVector = movementValue.Get<Vector2>();
- movementX = movementVector.x;
- movementY = movementVector.y;
- }
- // Update is called once per frame
- void FixedUpdate () {
- Vector3 movement = new Vector3(movementX, 0.0f, movementY);
- rb.AddForce (movement);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement