Starting crash error

Hello.

so the issue I’m experiencing is rather simple. I’m making my first project with GDevelop. I haven’t watched fully through any starting tutorials yet, but I’m pretty confused on how this problem is persisting despite it being so early in my first attempt at making a game with this program.

I’m on the title screen and I’m trying to program it to be able to start an opening cinematic. However, it crashes as soon as the code runs that starts a new sound after stopping the track used for the title screen. I’m really not sure how to fix this, as it seems like something that really shouldn’t be causing a crash.

The crash error says " A crash or error happened in the game. If you’re using JavaScript, verify your code. Otherwise, this might be an issue with GDevelop - consider reporting a bug. Full error is: Cannot read properties of undefined (reading ‘stopped’)"

Currently there are three objects, an animation sprite of a window, the text used for the title, and the sprite you click to begin the game. I’d like to know if anything like this has happened before and how I can fix it, are there any workarounds I can use instead of this code?

Hi there,
Interesting, I guess it might be the unload sound causing problems with the play sound directly below it, although they are different files. Try adding a delay between the two/removing the “unload” event".

Otherwise, if you would like to report it to GDevelop team, try to reproduce the error with as little steps as possible. ex: create project > create 2 sound > play 1 sound, unload it, play another sound

Can you try removing “-” from the file name ?

1 Like

I tried putting a delay. I want the sound change to be instant, I put a 0.1 second delay, and it crashed. I then put a 3 second delay, and it still crashed. I finally attempted a delay of 10 full seconds. The 10 seconds passed, and the error still showed up. It seems like the part of code that plays a new sound is the action causing the error. I also tried what the other comment suggested and removed the ‘-’ from the sound file name, but that didn’t fix it.

Is there some other way to make the title screen track stop playing and have another track instantly play?

I tried playing the first track as music instead of a sound, and playing the second track as a sound. That seems to have worked. However, attempting to have them both be music files returns the same error. it seems like the program can’t handle trying to have tracks suddenly swap if they’re the same type

This works for now

update: I’ve discovered Channels.

1 Like