Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | VarionDrakon |
There is a code and a file that exists and lies in the same directory as the file.cs
var FileTextDebug = new Godot.File();
FileTextDebug.Open("names.txt", File.ModeFlags.Read);
FileTextDebug.Close();
GD.Print("Debug:" + FileTextDebug);
Instead of the text what’s inside names.txt, outputs this:
Debug:[_File:1480]
What ideas does anyone have?
Ready-made code after the response, maybe someone will need it:
var FileTextDebug = new Godot.File();
FileTextDebug.Open("names.txt", File.ModeFlags.Read);
string DeugText = FileTextDebug.GetAsText();
FileTextDebug.Close();
GD.Print("Debug:" + DeugText);
Thanks for the answer: exuin