Mobile Movement Help

Hey, I need help converting something so that way it will work on mobile devices, mainly android right now.

using UnityEngine;
using System.Collections;

public class DesktopMovement : MonoBehaviour
{

    public float moveSpeed;
    public Vector3 input;
    public Rigidbody rb;



    void Update()
    {
        input = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
        print(input);
        rb.AddForce(input * moveSpeed);

    }
}

I need that to work on android using tilt as movement. Horizontal will be tilts left and right and vertical tilts up and down. Thanks

Hmmm, printing in update, that seems like something you want to delete before exporting it onto a mobile device
http://bfy.tw/67Vv

1 Like

Thx, with a bit of changes, it worked.