Need help with the gamepad code

So I need help with importing the gamepad code from the mozilla website, I can’t figure it out please help

ok then :+1:

I guess you can try to add this code to your wick project html page

<script>
window.addEventListener("gamepadconnected", function(e) {
  console.log("Gamepad connected at index %d: %s. %d buttons, %d axes.",
    e.gamepad.index, e.gamepad.id,
    e.gamepad.buttons.length, e.gamepad.axes.length);
});
</script>

and check if your browser detect the connected gamepads (it will log in the browser console) .
if it works you can use gamepadconnected event to know how many gamepads are connected and check each of them for buttons pressed and axis variations
you’ll find all specification here

I’m still having problems

pretty vague, don’t you think?
have you added the js to your html?
did you connect a gamepad?
what does the browser log?
coding is about doing small steps

1 Like

Well it tells me that the controller is connected but I’ve tried to use the code it tells me to use in the website and it didn’t detect button presses

what is the code that you used