We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Reproducing "drag stop" with gamepad joystick

Home Forums Puzzles Reproducing "drag stop" with gamepad joystick

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #20094
    GLiFTeK
    Customer

    hi,
    I’ve got a puzzle system working well with using the “when moved” puzzle.
    I have an object that when mouse dragged, it rotates, and when the drag is stopped, a procedure tweens the object back to it’s original rotational values (0,0,0).

    now,
    with the JOYSTICK on the game pad assigned to rotating the same object…
    What’s the best method to reproduce the “drop do:” feature of the “when moved” puzzle ….working on it while it’s joystick listener is working?

    i was thinking.. Gamepad input “Timestamps” maybe? (how would i designate a PREVIOUS timestamp? to compare the current one to??)

    i DO have a version (attempt) where i have if my joystick readings (clamped) read 0 then trigger the “tween – to -origin) thing.. however.. thought there may be a simpler way, since this also affects if the joystick hasn’t even been touched yet.
    … i definitely need to understand how to compare timestamps.

    any advice would be grand!
    thanks.

    EDIT: ..hmm.. checking out what you have going on in the updated Farmer’s Game Example..curious… do timestamps provide the time OF the input event AND the TYPE of event it was? ie: button 1 button 2 etc?

    #20141

    Hi,
    indeed the gamepads provide no info about when the exact buttons/axes were pressed/moved, just the actual state of the device. To overcome this problem, the GamePad API provides timestamps which are updated when something has changed with the device.

    So you need to compare the actual timestamp value with the previous one and if it changed you can poll buttons/axes to find what’s actually happened.

    Soft8Soft Tech Chief
    X | FB | LinkedIn

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.