How to shoot using the right mobile Joystick?

Hi all, I have been looking to answer for a long time, haven’t been able to find anything. I want to make a game with 2 joysticks, but I don’t know how to make the player face the direction of my joystick. My game is top down shooter, so the player is on the x and z axis. I am also having trouble with the bullet instantiating. They just keep coming. Is there a way to make a pause between them so there isn’t just a stream of bullets? Thanks in advance.

Facing the direction of a joystick and creating a pause between bullets are two separate questions. I recommend posting your bullet question separately, or doing some searches. The firing rate question has been asked and answered on many times on UA.

As for the joystick part of your question, you can cause your character to face the direction of the joystick by:

var x = Input.GetAxis("Horizontal");
var y = Input.GetAxis("Vertical");
if (x != 0.0 || y != 0.0) {
    var angle = Mathf.Atan2(y, x) * Mathf.Rad2Deg;
    transform.rotation = Quaternion.AngleAxis(90.0 - angle, Vector3.up);
}

Substitute the appropriate axes for the specific joystick for ‘Horizontal’ and ‘Vertical’.

I solved this problem in one of my games in an unconventional way. Robertbu’s method is probably more correct, but what I did worked:

-Save my position at the beginning of the update to a variable (origPos)

-Translate using the “Horizontal” and “Vertical” axes

-Save the new position to a variable (targetPos)

-Set my position back to origPos

-Get a Vector3 with the difference of the two (targetPos - origPos)

-Normalize that vector3

-Then set my “forward” direction to that vector3