public void createTextEffect(string text, int fontSize, int font, Color color, float duration, bool fade, Vector2 pos) { GameObject g = new GameObject("Text"); g.transform.SetParent(transform, false); TextEffect t = g.AddComponent <TextEffect>(); t.createText(text, fontSize, fonts[font], color, duration, fade); g.transform.position = pos; }