Hello everyone,
I’m currently working with an android application, but stuck with the touch inputs for the main player. I already have the movements setup, but i don’t know how to convert this into touch input.
This is the player movement script:
public class PlayerMovement : MonoBehaviour {
public float moveSpeed;
public GameObject deathParticles;
private float maxSpeed = 5f;
private Vector3 input;
private Vector3 spawn;
// Use this for initialization
void Start () {
spawn = transform.position;
}
// Update is called once per frame
void Update () {
input = new Vector3(Input.GetAxisRaw ("Horizontal"), 0, Input.GetAxisRaw ("Vertical"));
if(rigidbody.velocity.magnitude < maxSpeed)
{
rigidbody.AddForce(input * moveSpeed);
}
Help would be really appreciated.
Ps. Will it also be compatible with both iOS and Android?
Thanks.