Unity C# Coding: Read and Display information from a Text File.

preview_player
Показать описание
In this Unity Tutorial, i'll show you how to display information in a text file!

*Note, a vertical layout group and content size fitter was placed on the content window to allow the text objects to display one after another and scroll properly.

Рекомендации по теме
Комментарии
Автор

Simple, direct, clear, andd with results. How to do a tutorial 101 right here.

danielgarciagonzalez
Автор

Explained perfectly fine! An easy way to bind any text to be manipulated externally.

diamonsterish
Автор

Thx for the tutorial! But for displaying the text I used a slightly simpler method: I made a reference to the textfield and created a string called txt-> string txt = + "/Saves/" + "Chat" + ".txt"; Then I used this method to get the text -> string fileLines = File.ReadAllText(txt); And instead of using the foreach method I just set the textfield text equal to the string fileLines, that I've created. And it also works! :D

lephobix
Автор

Nice.
I really do need to start paying more attention to the usefulness of prefabs. Ive basically only been using them for visual objects, like characters, buildings etc..

michaelwilson
Автор

I've tried but it said !NullReferenceException: Obiect reference not set to an instance of an object

LouisCubingChannel
Автор

I followed the tutorial, but all of my code is stacking on top of each other in Unity. Does anyone know a fix?

OintmentNailhead
Автор

My GetText.cs file opened from Visual studio by Unity doesn't recognite it as a C# file (it doesn't recognize functions) and instead of Run button, VS show Attach button. Can you help me with this problem?

hai_vt
Автор

bro dat string list gonna save us all! bless

mmorkolf
Автор

Hello. I tried the tutorial but my text appears on the same location. I use a. txt file where I store the name and the score of each player who uses the game. What am I doing wrong?

ΜαρίαΛιάσκου-ιτ
Автор

Nice video, i just have one question, when my text displayed all the text was heaped how to solve this?

reginadominique
Автор

These text tutorials are great! I have subscribed and faved!

I've been researching this and xml to find the best way to store large amounts of texts (like poems and microfiction). The problem I'm having is that I can't figure out how to sort the data properly, which leads me to think I should have a separate text file for every single story. That way stuff like author, genre, date, etc. can simply be sorted by the order of their line.

One text file with tens of thousands of entries, or one folder with tens of thousands of files? Hard to say which is best at this point. I will keep watching for inspiration!

OwlTeaGames
Автор

Hi, i have a Null reference error at the line : recallTextObject.GetComponent, any idea ?

hugolammens
Автор

all recall object instantiate at same line at first how to handle?

muhammadumer
Автор

awesome video! I was able to finish my homework!

jacobov
Автор

nice channel it helped me with my game

arejustpolygons
Автор

Awesome Tutorial, for better understanding I would suggest you hint to the video discription. Almost missed That Information.

Unity_Disk
Автор

I am making a quiz style game for Android. Will this method work on Android or will some of it need to be changed? I been having some issues with text file displaying on mobile device but works fine on the unity editor. You explained it really well so hoping I can use it on mobile

oblivionempire
Автор

I wonder how can I exactly remove a specific line in recalled text?

ozgurgurbuz
Автор

I have a problem all the texts displaying in the same location and I followed your exact tutorial.

jamesohia
Автор

Hi
First of all thanks for the Video.
Is there a way to clear the ScrollView before refreshing it? Every time I try to print the file again, it just gets appended under the still displayed old data...

ERuopp-zylu
welcome to shbcf.ru