3

I have a TMPro text object in Unity as shown below: enter image description here

During the game level, I add texts which to this object which are animated using the DOText from DOTween, e.g. pickUpTextObj.DOText(pickUptext, 2f, true).SetRelative(true);

Once the levels is cleared and the new level is loaded, I need to clear this text field. I have tried all the three options as shown below in comment, but none of them is working. The text doesn't clear off and is stubborn. The text is attached to a DontDestroyOnLoad gameobject, and persists across levels.

pickUpTextObj = GameObject.Find("pickUpTexts").GetComponent<TextMeshProUGUI>();
//pickUpTextObj.DOText("\n", 0f, true).SetRelative(false);
//pickUpTextObj.DOText("", 0f, true).SetRelative(false);
//pickUpTextObj.text = "";
Vipin Verma
  • 5,330
  • 11
  • 50
  • 92
  • have you tried `ClearSubMeshObjects` or `ClearMesh`? – Bizhan Sep 21 '18 at 08:27
  • No, I haven't. Let me try them and get back to you. – Vipin Verma Sep 21 '18 at 19:00
  • Not sure, what is happening. At the time when I posted this question it was not working fine. I went back to work on the game today after 5 days, and it is working as expected. I didn't change anything or updated my unity during this time. – Vipin Verma Sep 26 '18 at 22:50

0 Answers0