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