- Home /
Problem with TextAsset
Hello,
I have a txt Windows file in my Assets folder (Unity 2017.4.0f1), and this code in a canvas:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class chatDefine : MonoBehaviour {
public TextAsset relato;
void Start () {
string text = relato.text;
print (text);
}
}
I drag the txt file to "Relato" in the Inspector, but when I run the program, all I get in the Console is:
UnityEngine.MonoBehaviour:print(Object)
I was looking all around the web, and I can´t get why I don´t see the actual content of the txt file printed in the console...
Thank you very much in advance to anyone who can tell me what I´m doing wrong here!
Your answer
Follow this Question
Related Questions
Set String Array or List to .txt File in a Builds Data Folder 2 Answers
Modifying a text file outside unity. 1 Answer
Cant append new line to an existing .txt file, instead it creates a completely new .txt file 1 Answer
NPC dialogue - Loading a text file to a string? 1 Answer
How to make a editable text list using external text file 1 Answer