Search the Community
Showing results for tags 'keyboard touch'.
-
Hi gentlemen! I need your help again! I would like play a mesh's animation with keyboard event. (I precise that the mesh is imported from Blender...) If I press my keyboard touch one time, I have this : You can see that my (bad) animation is correctly played... It's cool) But if I press in continue the touch, I have this : You can see here that the animation is "stopped" and restart if I push off the touch (the touche is push off when the mouse cursor move on the seconde .gif) So you understand my problem! If I want translate a mesh and animate it in the same time (like to make a walk animation for example) I must repair this bug! I use the window.addEventListener('keydown') and ('keyup') to manage keyboard. Here a example code : // On push on a touch...window.addEventListener('keydown',function(event){if (event.keyCode == codeToucheAvance){ scene.beginAnimation(skeleton[0],80,100); // Add true change nothing...}});// On push off a touch...window.addEventListener('keyup',function(event){if (event.keyCode == codeToucheAvance){ scene.stopAnimation();//This line in comment change nothing... }});The animation begin in the keydown event because in the scene.registerBeforerender(), the animation plays only when I push off the keyboard touch... Thanks you for your help! Zino
- 6 replies
-
- Mesh imported from Blender
- Animation
-
(and 2 more)
Tagged with: