How to properly display debug messages on UI
Up until now, I've been just using a regular text ui object to display whatever information I need to mo monitor, (for example, player position, input information, etc) and I would set all this info like this for ex:
using UnityEngine;
using UnityEngine.UI;
public class DebugUI : MonoBehaviour {
Text textBox;
void Start () {
log = GetComponent<Text>();
}
void Update(){
log.text = "blah blah whatever"
}
}
However, recently I've noticed that this method fills up my mesh memory so quickly that I need to force quit Unity before I run out of memory in around 4 minutes and it never clears, even when I exit out of play mode, it forces me to restart unity.
I've tried less taxing methods like only updating the text when the information changes, but since pretty much all the things I need on this update every frame anyway, it doesn't really help that much.
So is there any other way to display and update large amounts of text like this without filling up memory like this?
Your answer
Follow this Question
Related Questions
[HELP] To show wave number on a zombie survival game. 0 Answers
ui.text string matching doesn't work 0 Answers
Best way to attatch text to text script c# 1 Answer
My 'Score' Variable Is Not Printing To UI Text 1 Answer
"cannot implicitly convert type `UnityEngine.GameObject' to `UnityEngine.UI.Text' 2 Answers