How to convert this Code into mobile input

using UnityEngine;

public class PlayerController : MonoBehaviour {

public float moveSpeed = 10f;
public float rotationSpeed = 10f;

private float rotation;
private Rigidbody rb;

void Start ()
{
rb = GetComponent();
}

void Update ()
{
rotation = Input.GetAxisRaw(“Horizontal”);
}

void FixedUpdate ()
{
rb.MovePosition(rb.position + transform.forward * moveSpeed * Time.fixedDeltaTime);
Vector3 yRotation = Vector3.up * rotation * rotationSpeed * Time.fixedDeltaTime;
Quaternion deltaRotation = Quaternion.Euler(yRotation);
Quaternion targetRotation = rb.rotation * deltaRotation;
rb.MoveRotation(Quaternion.Slerp(rb.rotation, targetRotation, 50f * Time.deltaTime));

}

}

Hi and welcome, please use code tags. It’s the <> button when you are in the text editor here. It adds syntax highlighting and makes everything easier to read.

You can use Input.GetTouch() to get all the currently active touches on the screen.

Depending on the gesture, you can then use these to get, for example, horizontal motion. Each Touch has information about different things, which you can each up on here: Unity - Scripting API: Touch

If you are doing more complex gestures and stuff then you may wanna consider using some asset for it.