Modifying game files

Hey there. I’m making my first game right now and I want to have the game files change during gameplay. Something like Doki Doki Literature Club where while you play the game, some files are getting deleted, added or modified.

So basically what I’m asking is how to make it so…

Player reaches certain point in game > delete/create/modify: image.jpg(or a model or whatever).

Thanks in advance!

Unity game assets are compiled and compressed into a runtime format / container and are not accessible as individual files. Even if this would be working unity would not react kindly of missing files.
You could look into asset bundles or loading data from the streaming assets folder via unity webrequest

Perhaps Unity Remote Config, but it doesn’t modify “files” https://unity.com/remote-config

What are you trying to achieve with this deleting of files? Unity includes the Asset Bundles feature, which allows you to add additional assets (or remove). You can also put files in the StreamingAssets folder, which are included as separate files instead of bundled into the build like normal assets.

As already mentioned you can use Remote Config or the older but similar Remote Settings features to turn on/off functionality of your game, or make settings to modify the behavior. For example I currently use Remote Settings to provide the latest news on the game, which I pop up when the player hits the main menu, without having to spin a new build.

You can access the game’s install directory via the Application.dataPath variable. From there, use the basic System.IO APIs to create/modify/delete files. Just don’t delete anything important!