How to get 360 directions from [joystick/mouse] instead of 8?

Hello, there,

I am working on a game, where player is used to move with [WASD / left joystick], and attack with [mouse(delta) / right joystick]. I have set both of them as Inputs, but i am meeting a problem. There’s a game by supercell, called “Brawl stars” and if you have ever played that, you should know there is a sketch which shows where you are sbout to shoot. I am trying to make exact on but with a spotlight, so the light shows where you are about to shoot.

Here’s a picture of my game look:

alt text

And here’s another of Brawl stars look:

alt text

As I said, I have a problem and it is about aiming control. I can fully control the ragdoll, but the spotlight doesnt follow the mouse, I tried making the spotlight setting its rotation exact as joystick/mouse movement rotation, but i got it only to 8 directions (x+y+/x+y-/x-y-/x-y+/x+y0/x-y0/x0y-/x0y+), meaning i can shoot only in 8 directions, which isn’t enough, as i want it to be able to shoot in any (360°) direction.

Any suggestions, how can I extract more directions out of joystick/mouse(delta) Input?
Here’s how I did it:

private void FixedUpdate()
{
    if (aimInput.x != 0 || aimInput.y != 0)
    {
        aimRad = Mathf.Atan2(aimInput.x, aimInput.y);
        aimDeg = Mathf.Rad2Deg * aimRad;
    }
    aim.transform.rotation = Quaternion.Euler(0, aimDeg, 0);
}

Your spotlight used in the Player object Attach so, your Spotlight work properly…