-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Hi, I've been developing a game with GDevelop and I've encountered a small problem related to how the engine handles file paths.
I access an audio file already listed in the game's resources from JavaScript (it uses an extension) like this:

But there's a problem.
If I try to use "assets/sounds/" + filename + ".ogg", I get this error:

That is, if the resource is listed under this name
![]()
What's happening is that to fix it, I have to manually change the resource name like this:
![]()

Instead of the resource name being "assets\sounds\ringtone.ogg", it has to be "assets/sounds/ringtone.ogg"
But I don't really understand why the engine uses a backslash \ in the resource name on Windows, but uses a forward slash / in the path the engine recognizes.

Is there a way to resolve this? Or am I missing something?
Steps to reproduce
- Load a file to list it in the resources.
- Use an extension like "Sounds and music by filename".
- Use a / in Windows to call the sound from game events.
- Try using \ as well without changing the resource name.
GDevelop platform
Desktop
GDevelop version
5.6.262
Platform info
Details
OS (e.g. Windows, Linux, macOS, Android, iOS)
Windows
OS Version (e.g. Windows 10, macOS 10.15)
Windows 11 Pro
Additional context
I don't consider it an extension problem, but rather a problem that comes to light when using said extension; the engine confuses the paths and for some reason cannot find the file if you do not put the / in the resource name.