Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Saafris

1
Posts
1
Topics
1
Following
A member registered Jun 29, 2016

Creator of

Recent community posts

(1 edit)

Hello!

Was playing around with Super Text Mesh and working on adding text to the screen through a simple script.

Ran into an odd bug that I wasn't sure what was causing it. If I manually add the STM component to a game object, it acts fine and shows up correctly. But if I add a STM component through code it does the following:

1. It does not display at all, and it logs 2-3 identical errors about a null reference.

2. If I go into the inspector and select the game object that has the STM component attached, the text will begin rendering as error pink boxes.

3. If I disable and re-enable that component, it will begin rendering correctly.

Below are those 3 situations, and then my code that adds it to a game object (which is a child game object to something else)
What is the correct way to create a STM text object through scripts, or am I doing it correctly and maybe something has gone wrong with my STM package? Thanks!

Before selecting gameobject


After selecting gameobject

Disable and reenable