Gamepad input does not unlock audio

Not favoritedFavorited Favorited 0 favourites
  • 4 posts
From the Asset Store
Unlock Levels, Worlds & skin plus add coins by watching ads
  • Hi everyone,

    I’m having an issue in my game:

    When the player starts the game with an Xbox controller (pressing a button on the Play screen), the background music does not start. If I click/tap the Play button instead, the music works fine.

    It looks like the browser doesn’t treat gamepad input as a valid “user gesture,” so the AudioContext never unlocks.

    Has anyone found a way to unlock audio using gamepad input, or a reliable workaround inside Construct 3?

    Thanks in advance!

  • Hi,

    Totally get the frustration—this is a browser policy thing. Gamepad button presses don't count as a "user gesture" for unlocking the AudioContext (clicks/taps/keys do), so music stays silent.

    Quick workaround in C3:

    On your Play screen, track input type (e.g., var "startedWithGamepad = false" on Gamepad > On any button pressed).

    If gamepad starts the game, immediately switch to a simple "Click/Tap to Start Music!" layout with a big transparent button or full-screen touch area.

    On that layout: Mouse/Touch > On any click/tap object > Play audio > Go to game layout.

    Keeps it smooth for controller users without breaking mouse starts. Works like a charm in my project!

    Let me know if you need event screenshots. 👍

  • Browsers sometimes start pages muted until a "user gesture" (i.e. any kind of input from the user) in order to prevent abuse. Construct does try to start audio playback in "gamepadconnected" events, which is an event that fires when you first press a button on a gamepad, and IIRC it is supposed to be an allowed way to start audio playback. However it doesn't look like it works in Chrome - it still blocks the audio playback. I filed an issue with Google about that - presumably they'll need to fix that before it works.

    Note roden1 - the style of your post is very much like an AI chatbot (and the em dash is a pretty good giveaway). Please see the Forum & Community guidelines: posts generated with AI are not allowed.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ashley Thanks for filing an issue.

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)