AnimationPlayer's Call Method track not running on exported web project until application is foregrounded

Godot Version

4.4.1

Question

I’m having a problem which happens on my web export, but not when I run the app normally. I have an animation that is designed to call play() on an AudioStreamPlayer when the program starts up. This works fine when I run the app normally, but when I export for web, the sound does not play until I click on the app to foreground it.

Since this sound needs to be synced with the animation, having the sounds delay until the user decided to click on the app is throwing everything off. I’m not sure if the issue is with the AudioStreamPlayer or with the Call Method track, but I need this to play at the right time in the timeline.

Is there a way to fix this?

image

This is a limitation of the web platform and Godot can’t do anything about it. Audio can only play after the user interacts with your game.

An option is to show a big button at the start of your game to make the user to click on it and then play the animation.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.