Hi,
I have a mesh geometry that I am trying to move using WASD.
However, it sorts of stop to change the operation as in from moving forth to back or moving back to rotate. I guess it is because it is reading only the single key press.
Here is my code for moving the object:
var moveDistance = 0.5;
var keyCode = event.which;
if (keyCode === 87) {
object.translateX(moveDistance);
} else if (keyCode === 83) {
object.translateX(-moveDistance);
} else if (keyCode === 65) {
object.rotation.y += (Math.PI / 2) * 0.05;
} else if (keyCode === 68) {
object.rotation.y -= (Math.PI / 2) * 0.05;
}
How can I make it smoother/ detect multiple keypresses?
Thank you.