My character’s are instantiated using a prefab. This prefab has a 3DText GameObject attached to it. I want to modify this Text with the nickname entered in the GUI.
My question is how can I access the 3DText of the instantiated Prefab.
var player=Network.Instantiate(PlayerPrefab, SpawnObj.position, Quaternion.identity, 0);
var textMesh: TextMesh=(player.GetComponent(TextMesh) as TextMesh);
This code gives me this Error:
NullReferenceException: Object reference not set to an instance of an object