360 aiming with a gamepad using the right stick

0 favourites
  • 11 posts
From the Asset Store
JPEG format 364x HD backgrounds in 2688 x 1536 Resolution
  • im having problems getting 360 aiming with the gamepad would be great if anyone had an idea how to. its for my 2 player arcade game

  • I believe you could get the angle with an expression like angle(0,0,Gamepad.Axis(0,0),Gamepad.Axis(0,1)), but unfortunately I can't test it as no browser recognises my Logitech controller.

    EDIT: I did some digging and found a neat utility called x360ce that tricks Windows into thinking any USB gamepad is an Xbox one. After setting it up, I tested it and the above expression does indeed work.

  • GeometriX that's really neat!

  • Thanks GeometriX !

    (ive got a official 360 controllers so i should be fine

  • it seems to just make the the left stick for aiming instead. <img src="smileys/smiley24.gif" border="0" align="middle" />

  • Yeah, I realised after I fully tested with movement and aiming that I was referring to the left analogue stick there.

    To be frank, you should know how to fix this - you need to spend some time working through the manual and trying to understand how the gamepad object works and how axes are indexed.

  • ive been messing with it still trying to make it work for me thanks

  • Someone posted a similar question yesterday here:

    construct.net/en

    The line of code that Sargas posted at the end does exactly what you want.

    you can use the angle the stick is at to move things around

    angle(0,0,Gamepad.Axis(0,0),Gamepad.Axis(0,1))

    after this you just need to add a "move forward" action when "something"

    I've been messing with it myself and this is what I've come up with:

    <img src="http://i.imgur.com/KdGkLRZ.gif" border="0" />

  • andreyin: That's the exact expression that I posted in this very thread :P

    You might notice that the expression doesn't do exactly what the OP requested, but since there's still some confusion about this, here's the expression that you use to get aiming with the right analogue stick: angle(0,0,Gamepad.Axis(0,2),Gamepad.Axis(0,3)).

    Note the axes specified there - those refer to the right stick, whereas 0 and 1 (as in my first post in this thread) refer to the left stick.

    The example capx that I posted in the other thread earlier.

  • GeometriX Whoops, should've read the thread before posting! Sorry! D:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh great! I really needed this for my game.

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