How do I read Gamepad axises in best way for this...

Get help using Construct 2

Post » Thu Mar 16, 2017 8:38 pm

Hello.

I have added events to make the movement a little more responsive and polished.
It works for keyboard.

Keyboard is "On Any Key released"

But for Gamepad direction it is very different beast. Not only for its numerous values for both X and Y axises..
But also for no "released" trigger that is simple to use, no the value is feeding out all the time continuous.. so if value is 0, it will trigger value 0 every tick (or every time it is sampled by the browser)...

I thought maybe not add "Trigger once while true". But to work with the OR block for all the different axises..

Or maybe I am totally wrong in my idea.

The code for keyboard is here:
Image

How would you do it for gamepad to get a nice trigger that is like "On Key Released"?
B
58
S
18
G
13
Posts: 447
Reputation: 10,740

Post » Thu Mar 16, 2017 9:47 pm

I came up against this very thing. I haven't perfected yet, but this is what I've been working with:

So far I'm only using it for RIGHT/LEFT

Based on the axis I set the direction state to be either right or left. Then when the player let's go (Axis = 0) check what the state was last.
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Thu Mar 16, 2017 9:50 pm

Image

Image
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865


Return to How do I....?

Who is online

Users browsing this forum: Bing [Bot], Lancifer and 29 guests