How to load files after the project is packaged?

Yunze Gu,

Could you be more specific, what do you want to do with this file once you find it?

If I want to find a file, what should I do?

What I want to do is to load the content of a file when the project is running.

Do you mean opening the direct .uasset files inside your content project folder or something else? You cannot open and edit a file directly unless you are inside the editor itself. Can you give me an example of what file you were wanting to load?

The thing is that, now I save some useful info in the .txt file. And in my project, I want to load the file content and do sth. If I don’t package the project, I can find a file in the project directory. But if package the project, how can I find a specific file and load its content?

Hey Yunze Gu,

So what’s happening here is all of your files are being compressed into a .pak file. That’s why you’re unable to find the asset in the directory. You can package without using a .pak file by disabling the Use Pak File option in Edit->Project Settings->Packaging. However, this leaves your game code vulnerable to being stolen as users will be able to access all of the files directly. If you’re concerned about keeping that private, you’ll need to look into using an encrypted .pak file.

As far as opening a file and actually using it in the game goes, I don’t believe that this is possible. If you are trying to actually affect the game with a text file, you’ll need to load it into memory beforehand, because just opening the asset will not do anything other than let you view it. Anything you want to happen in your game needs to be coded or set up in the editor itself before you package.

Let me know if you have further questions regarding this.

Have a great day