Aiming With The Right Stick In TDS (Gamepad Extension)

Hello!

I’m making a Top Down Shooter and I’d like to implement gamepad controls. I do have the Gamepad extension installed and I have successfully gotten the left stick to move the player around. The problem is I’m not having any luck getting the right stick to aim the gun (I have the gun “pinned” to the player). I have used the expression builder to see what options are available, but I don’t quite understanding how to use those options. I would greatly appreciate if someone could walk me through the steps to get this to work!

Please note, I do not wish to include the virtual joystick extension as I don’t want touch controls in the game.

How do you want the aiming to work? Rotate in place?

How are you pinning the gun to the player? A screen shot of the events would be useful.

I want it to work by aiming the gun at a fixed point, in the direction/rotation that the stick is moved. I’ve pinned the gun to the player using an origin point. I will share screenshots of what I have now (using mouse position) as well as the solution that was used as an example in Construct 3. The Construct 3 example might be helpful to someone like you, who is more experienced with GDevelop than I am. :slight_smile:

These are my events:

These are screenshots of the Construct 3 example:

The Global Variables for the sticks:

The condition and action:

The Evaluate Expression condition and value:

The Set Value action:

The Set Angle action:

I hope this helps you help me!