Home › Forums › Puzzles › Keyboard Events unresponsive after double tapping key event input/function
- This topic has 67 replies, 2 voices, and was last updated 3 months, 2 weeks ago by c4cc.
-
AuthorPosts
-
2023-10-03 at 5:33 pm #67272c4ccParticipant
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?2023-10-03 at 7:52 pm #67282kdvParticipantAfter animated rotating from 180 to 360 the actual final angle is somewhere around
-1.4033418597069752e-14
which is not equal to0
. 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#roundOr rotate from 180 to 0 instead of 360.
Puzzles and JS coding. 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 the meaning at all.
2023-10-04 at 3:57 am #67284c4ccParticipantOr 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?
2023-10-04 at 4:15 am #67287kdvParticipantWhich 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 coding. 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 the meaning at all.
2023-10-04 at 9:14 am #67289c4ccParticipantThis worked, thanks. (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.
- This reply was modified 1 year, 2 months ago by c4cc.
2023-10-04 at 1:34 pm #67293kdvParticipantUse debugging to find the reason which is very simple.
Puzzles and JS coding. 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 the meaning at all.
2023-10-04 at 3:36 pm #67296c4ccParticipant2023-10-04 at 4:13 pm #67297kdvParticipantThat 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 coding. 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 the meaning at all.
2023-10-04 at 4:34 pm #67298c4ccParticipant2023-10-04 at 4:44 pm #67299kdvParticipantBad try. Wrong place.
Puzzles and JS coding. 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 the meaning at all.
2023-10-04 at 5:08 pm #67300c4ccParticipant2023-10-04 at 5:15 pm #67301kdvParticipantIs
-180
equal to180
?Puzzles and JS coding. 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 the meaning at all.
2023-10-04 at 5:28 pm #67303c4ccParticipantIs
-180
equal to180
?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?
2023-10-04 at 5:29 pm #67304kdvParticipantThink.
Puzzles and JS coding. 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 the meaning at all.
2023-10-04 at 5:51 pm #67305 -
AuthorPosts
- You must be logged in to reply to this topic.