Need some help adding controller input to my aiming script

So I’ve put myself in a pickle, and I think I’ve complicated things beyond my understanding.

I used a tutorial a long time ago, now I’m revisiting to add controller compatibility in my inputs.

This is a top down 2D game, and I want to use the right joystick to aim 360. Right now, this is controlled using the mouse. The location of the cursor also faces the player left or right by flipping the sprite animation. It’s all very simple using a mouse, so I need help understanding what my next move is to add a controller.

Here is what I have at the moment:

//Flipping animation per cursor location
            Vector3 mousePosition = Input.mousePosition;
            Vector3 screenPoint = CameraController.instance.mainCamera.WorldToScreenPoint(transform.localPosition);

            if (mousePosition.x < screenPoint.x)
            {

                if (!isDodging)
                {
                transform.localScale = new Vector3(-1f, 1f, 1f);
                gunArm.localScale = new Vector3(-1f, -1f, 1f);
                }

                else
                {
                transform.localScale = Vector3.one;
                gunArm.localScale = Vector3.one;
                }

            }

            else
            {
                transform.localScale = Vector3.one;
                gunArm.localScale = Vector3.one;
            }

          
         

            //rotate gun arm
            Vector2 offset = new Vector2(mousePosition.x - screenPoint.x, mousePosition.y - screenPoint.y);
            float angle = Mathf.Atan2(offset.y, offset.x) * Mathf.Rad2Deg;
            gunArm.rotation = Quaternion.Euler(0, 0, angle);

Obviously when using a controller, I need to lock the cursor a certain distance from the player.

Thoughts on this? Thank you!

Just bumping, any love?

I resolved this. Not worth it to share, far too complex for this post.