Joystick Aim

This is my code and I need to implement a second joystick that aims the character
my game is a top-down shooter

public class PlayerMovement : MonoBehaviour
    public float moveSpeed = 5f;
    public Rigidbody2D rb;
    public Camera cam;
    public Joystick joystick;
    Vector2 movement;
    Vector2 mousePos;
    public static Vector3 playerPos;
    void Update()
        playerPos = transform.position;
        movement.x = joystick.Horizontal;
        movement.y = joystick.Vertical;
        mousePos = cam.ScreenToWorldPoint(Input.mousePosition);
    private void FixedUpdate()
        rb.MovePosition(rb.position + movement * moveSpeed * Time.fixedDeltaTime);
        Vector2 lookDir = mousePos - rb.position;
        float angle = Mathf.Atan2(lookDir.y, lookDir.x) * Mathf.Rad2Deg;
        rb.rotation = angle;

The conventional wisdom is that a mouse and keyboard setup is better for playing shooters than a controller, because mice are inherently faster and more precise aiming devices.

A big point of comparison for the controller vs keyboard and mouse is the analog buttons and joysticks. If you press your controller’s triggers harder, you go faster. You can also use the joystick to vary turning angles slightly. In contrast, a keyboard and mouse setup only allows for binary control input.


have you figured out how to do it?

I need it for my game.