This is my first attempt to use Defold and i can’t figure out how to use files here(
The file is in main, it has text in it, but it return nil.
ERROR:SCRIPT: main/text.script:9: attempt to index local ‘file’ (a nil value)
stack traceback:
main/text.script:9: in function <main/text.script:4>
function init(self)
local file = io.open("/main/sceneinfo.txt", "r")
if not file then
print("Не удалось открыть файл!")
end
local text = file:read("*all")
file:close()
print(text)
label.set_text("#label", text)
end