Music odd behavor

Hello, i have a button that enable/disable an entity with the sound component, but it work just if i disable the entity at the start, if enabled the button don’t interrupt the music. Is there a reason for that?

Hi @ayrin, are you able to provide a sample project link?

I am not sure what’s the issue based on what you describe.

Hi @Leonidas you can just lunch the game from editor and try to use the speaker button in the right top corner of the screen, the script handle that button drawVolume function at lines 81-104 but if the entity is disabled at start it work, else it doesn’t…that’s a mistery

At a guess, this line may be the problem:

            var music=this.Camera.findByName('Village music');

Chances are that ‘Village music’ is not created before the button tries to find it when it is enabled on start.

@Leonidas that’s not the issue, i moved the camera component before the root component so the output.js is launched after the Village music but the issue isn’t solved