unity – Add a virtual joystick to a top down 2D game that uses Input.GetAxis

I have a 2D top down game with a perfectly working movement system, however, I decided to switch to mobile, and faced a problem. I HAVE NO IDEA how to add add a Joystick (well, adding it is not that big of a deal) and connect it to my existing system.

Every tutorial out there is about implementing it from scratch.. What I thought was, you take a something like “Input.Joystick(“Horizontal”)” (NOT A REAL THING) and replace your Input.GetAxis with it. Apparently it’s not that easy

Basically I need to move left ,right, up, down, control the mouse and shoot.

My movement code:

PLAYER:

void Update()
{
    Vector2 moveInput = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));
    moveAmount = moveInput.normalized * speed; 
 }

private void FixedUpdate() {
    rb.MovePosition(rb.position + moveAmount * Time.fixedDeltaTime);
}

GUN:

void Update()
{
    Vector2 direction = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position;
    float angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;
    Quaternion rotation = Quaternion.AngleAxis(angle - 90, Vector3.forward);
    transform.rotation = rotation;
}