![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | iamkhan |
I am making a project in which user is required to get files from os is there any way to get files
![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | iamkhan |
I am making a project in which user is required to get files from os is there any way to get files
![]() |
Reply From: | magicalogic |
Yes using File class like this example from the docs.
func save():
var file = File.new()
file.open("user://save_game.dat", File.WRITE)
file.store_string(content)
file.close()
func load():
var file = File.new()
file.open("user://save_game.dat", File.READ)
var content = file.get_as_text()
file.close()
return content
You may need to read about Data Paths here to see where the files are stored in the os here: https://docs.godotengine.org/en/3.3/tutorials/io/data_paths.html