[fieldsofexplode.netlify.app]
(https://fieldsofexplode.netlify.app)
Controls on pc - w,a,s,d and arrows. Controls on mobile - swipes
[fieldsofexplode.netlify.app]
(https://fieldsofexplode.netlify.app)
Controls on pc - w,a,s,d and arrows. Controls on mobile - swipes
Hi @ARAMONIS and welcome to the forum!
I tried the app but I can’t move. wasd or arrow keys didn’t change anything.
Thanks for the feedback. Strangely, everything worked on my computer. I’ll try to fix it
I think i fixed it
Is it still the same link? Because if so, then I’m still unable to move. Of course, my poor knowledge of your language doesn’t help with the understanding of the controls ![]()
Did you enter the keyCode or just the character?
Try this:
scene.onKeyboardObservable.add((kbInfo) => {
switch (kbInfo.type) {
//on key press
case BABYLON.KeyboardEventTypes.KEYDOWN:
switch (kbInfo.event.key) {
case "w":
case "W":
case 87:
console.log ("forward");
break
case "s":
case "S":
case 83:
console.log ("backward");
break
case 65:
case "a":
case "A":
console.log ("left");
break
case 68:
case "d":
case "D":
console.log ("right");
break
}
break;
}
});
The editor did not save the changes
Updated again.
I’ve always used “event.keyCode”, but it turned out that this is an outdated method.
Still the same link? Now the GUI is gone and I cannot start the game.