title: How to change 3D - TextMesh Pro inside string with script?
body: <p>I have keyboad prefab and 6 keys prefab. I put keys with <strong>Instantiate</strong>. Every keys have got TextMeshPro objects. I need to change these characters with script. But when I try to get TextMeshPro component, console returns null.</p>
  
  <pre><code>Debug.Log(GetComponent&lt;TextMeshPro&gt;());
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/rWKvW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rWKvW.jpg" alt="enter image description here"></a></p>
  
  <p>My code part is here;</p>
  
  <pre><code>private void SetUp()
  {
      // Global Screen Height
      var worldScreenHeight = Camera.main.orthographicSize * 2.0;
      // Global Screen Width
      var worldScreenWidth = worldScreenHeight / Screen.height * Screen.width;
      // Keyboard
      var keyboardSize = GetComponent&lt;SpriteRenderer&gt;().sprite.bounds.size.x;
      var neededScale = worldScreenWidth / keyboardSize;
      var neededYPosition = (worldScreenHeight / 2) - (keyboardSize / 2);
      transform.localScale = new Vector3((float)neededScale, (float)neededScale, 0);
      transform.position = new Vector3(0, -(float)neededYPosition, 0);
      for (int i = 0; i &lt; Characters.Length; i++)
      {
          double angle = ((i / (Characters.Length / (double)2)) * Math.PI);
          GameObject newObject = Instantiate(Keys, new Vector2((float)(keyboardSize / 2 * 0.6 * neededScale * Math.Cos(angle)), (float)(keyboardSize / 2 * 0.6 * neededScale * Math.Sin(angle) - neededYPosition)), Quaternion.identity, transform) as GameObject;
          newObject.transform.localScale = new Vector3(0.5f, 0.5f, 0);
          // I can't access textmeshpro
          Debug.Log(GetComponent&lt;TextMeshPro&gt;());
      }
  
  }
  </code></pre>
  
  <p>How can change strings in TextMeshPro?</p>