0 votes

why mesh loaded via load() is not displayed in Godot? How do I import a file located on the C:/, D:/ or E:/? If I use this code:

$PlayerMesh.mesh = load("D://Player.vox")

So I have an import error that requires me to import this file, how do I fix it (import this file)?

Godot version 3.5.1
in Engine by (90 points)

1 Answer

+1 vote

Just move the mesh to any subfolder of your resproject folder

by (8,101 points)

I'm sorry, but it seems you didn't understand me. Do you mean I should copy the file from D:// to res://?

yes, open your Project folder, find res:// there and paste your mesh here. It will appear in editor, with options for custom import

I think you did not understand my question. The user will select a file in his file system, and the program, already exported in exe, will import it. I know how to transfer resources for game objects to res://))) But I need access to files that will be outside of res:// and user://. Can I import without moving it to res://? Because Godot Engine says it can find the file but can't use it because it doesn't have an .import file to use in the project.

You are right, I didn't understand this problem.
I don't think load will solve this kind of task, but maybe You could try to open this file using Directoryfunctionality.
If it won't work, I would suggest uploading mesh to res folder, and manually copying .import file that will appear there after running your project.

Sorry, but I meant that the player will create the Mesh file for the player skin himself. I don't know what kind of file it will be, so I can't move it to res, run it and import it to .import. Is it possible to make an .import file through some function by specifying the path to the Mesh file?

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.