Home › Forums › Puzzles › Keyboard Events unresponsive after double tapping key event input/function
- This topic has 67 replies, 2 voices, and was last updated 5 months, 3 weeks ago by
c4cc.
-
AuthorPosts
-
2023-10-03 at 5:33 pm #67272
c4cc
ParticipantFor 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 #67282kdv
ParticipantAfter 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 #67284c4cc
ParticipantOr 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 #67287kdv
ParticipantWhich 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 #67289c4cc
ParticipantThis 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, 4 months ago by
c4cc.
2023-10-04 at 1:34 pm #67293kdv
ParticipantUse 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 #67296c4cc
Participant2023-10-04 at 4:13 pm #67297kdv
ParticipantThat 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 #67298c4cc
Participant2023-10-04 at 4:44 pm #67299kdv
ParticipantBad 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 #67300c4cc
Participant2023-10-04 at 5:15 pm #67301kdv
ParticipantIs
-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 #67303c4cc
ParticipantIs
-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 #67304kdv
ParticipantThink.
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 -
This reply was modified 1 year, 4 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.