Seeking Guidance: Implementing Precise Gamepad-Controlled Cursor within Radius

1 favourites
  • 4 posts
From the Asset Store
Mouse cursor is something that the player controls and sees all the time, that's why it is so important to make it cool!
  • Hi, I'm looking to implement a cursor that is restricted to a particular radius (typically to the origin of a player object ) that the player can control precisely using the gamepad joysticks. Does anyone know how I can do this?

    I tried doing this using a combination of the 8-direction controller and pin behavior. The issue I face is that the curser's movement is not precise and always restricted to 8 directions.

    Following is a screen recording of the output I got.

    youtu.be/6SGuYGaiTWg

    The following is a reference from two games, 'Dust and Neon' and 'Synthetik: Legion Rising.'

    youtu.be/g1JWIwaD0Ic

    youtu.be/Fryhpt9J5MU

    I'm looking for an outcome similar to how the aiming cursor behaves in these games. You can notice that although the player uses a gamepad joystick, it's a lot more precise and accurate. Hope some one will be able to guide me on this. Thanks in advance.

  • Here you go:

    dropbox.com/scl/fi/ll81tlpy14kxmaqcn43qn/GamepadAim.c3p

    See events #9 and #10

  • OMG!! This is exactly what I've been looking for. Thanks so much... :)

    Never expected someone would do the whole thing and send it to me as a project file. This is so amazing. :D

    My brain hurts every time I try to understand how exactly you made this work. I think I will have to spend a little more time analyzing it before I can understand it properly, just thought I would respond back before I do that. Thanks once again. :)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • No worries!

    Gamepad stick returns two values from -100 to +100, for horizontal and vertical axes.

    angle(0, 0, axisX, axisY) will give you the angle of the stick

    distance(0, 0, axisX, axisY) will give you the distance - how far it is from the center.

    Using these values you can move your cursor.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)