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.

Keyboard Events unresponsive after double tapping key event input/function

Home Forums Puzzles Keyboard Events unresponsive after double tapping key event input/function

Viewing 15 posts - 1 through 15 (of 65 total)
  • Author
    Posts
  • #67272
    c4cc
    Participant

    For context: I was trying to get a character to turn around when certain keys were tapped rapidly twice:

    Key events are responsive before that quick double tapping event,
    but after I double tap keyD (turning left to right), key events are now unresponsive. So how do I
    get key events to be responsive?

    kurumii

    #67282
    kdv
    Participant

    After animated rotating from 180 to 360 the actual final angle is somewhere around -1.4033418597069752e-14 which is not equal to 0. That’s very-very close but not equal to zero.
    Use this puzzle to round -1.4033418597069752e-14 to zero
    https://www.soft8soft.com/docs/manual/en/puzzles/Numbers.html#round

    Or rotate from 180 to 0 instead of 360.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67284
    c4cc
    Participant

    Or rotate from 180 to 0 instead of 360.

    Thanks, this indeed worked. But I’d prefer my character to face the player when turning.

    Use this puzzle to round -1.4033418597069752e-14 to zero

    Which part of the puzzles do I put this in?

    • This reply was modified 7 months ago by c4cc.
    • This reply was modified 7 months ago by c4cc.
    #67287
    kdv
    Participant

    Which part of the puzzles do I put this in?

    But I’d prefer my character to face the player when turning.

    Rotate from 0° to -180° and from -180° to 0°
    In Verge3D valid angles are in the range -180°…180°. Angles out of this range don’t exist and a special formula recalculates them to be within the range. For example, if you rotate your object from 0° to 240° the final angle will be -120°.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67289
    c4cc
    Participant

    2023-10-04-08-12-14

    This worked, thanks. :good: (note:, apply this to “Player movement – left to right: every frame – do“)

    Rotate from 0° to -180° and from -180° to 0°
    In Verge3D valid angles are in the range -180°…180°. Angles out of this range don’t exist and a special formula recalculates them to be within the range. For example, if you rotate your object from 0° to 240° the final angle will be -120°.

    I tried this, but my character got stuck after rotating once, and can only move up and down.

    kurumii

    • This reply was modified 7 months ago by c4cc.
    #67293
    kdv
    Participant

    Use debugging to find the reason which is very simple.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67296
    c4cc
    Participant

    I have tried
    kurumii

    And this is the result.

    kurumii

    #67297
    kdv
    Participant

    That was a bad try. Senseless. Think more. You should read an object’s rotation at the end of an animation but not an object’s name.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67298
    c4cc
    Participant

    New Try:

    kurumii

    kurumii

    #67299
    kdv
    Participant

    Bad try. Wrong place.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67300
    c4cc
    Participant

    Print to console in new place:

    kurumii

    Console results

    kurumii

    kurumii

    kurumii

    kurumii

    kurumii

    #67301
    kdv
    Participant

    Is -180 equal to 180?

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67303
    c4cc
    Participant

    Is -180 equal to 180?

    No, it isn’t. So if I want my character to spin facing the player/screen, via rotating from 0° to -180° and from -180° to 0°, how do I do this?

    #67304
    kdv
    Participant

    Think.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67305
    c4cc
    Participant

    Problem is, we can’t just put negative into the degrees number puzzles

    • This reply was modified 7 months ago by c4cc.
    • This reply was modified 7 months ago by c4cc.
Viewing 15 posts - 1 through 15 (of 65 total)
  • You must be logged in to reply to this topic.