0 votes

I'm trying to make a 2D card editor where you can upload an image of your character, but i ran into an issue where the path would not show the base directory (C:/ , D:/ , etc) in the "current path" section. That caused Godot to not be able to load it. There's no special code involved, but here are a couple of screenshots:

Screeenshot 1

Screenshot 2

As you can see, there's no "(letter)://" in the current path and dir. Is there a solution to this?

in Engine by (19 points)

1 Answer

+1 vote

It looks like indeed current_path does not contain the drive, and there doesnt seem to be a way to get which drive is selected.

If you use the file_selected signal, this one will give you a valid path when the user chooses and validate a file.

You can also set the initial path from script and that should select the correct drive when the dialog opens.
However if you did intend to hardcode the path at which the dialog opens in editor, then it might fail to open that path cuz it saves no info about which drive to choose in tscn...
The closest issue I found on Github is https://github.com/godotengine/godot/issues/30872, but it still isn't directly related so a new issue or proposal should be posted.

by (28,886 points)
edited by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.