The Code:
gameObject.Find(“AOB”).GetComponent(Text).text=“Amount of Bullets:”+Bullet;
it returned "Unknown identifier:‘Text’. "
does the Text Component have another name instead of “Text”?
The Code:
gameObject.Find(“AOB”).GetComponent(Text).text=“Amount of Bullets:”+Bullet;
it returned "Unknown identifier:‘Text’. "
does the Text Component have another name instead of “Text”?
if it is c#
using UnityEngine.UI;
Thank you for the reply, but It is Javascipt. do u have solution for Js?
gameObject.Find("AOB").GetComponent(UI.Text).text="Amount of Bullets:"+Bullet;
It worked!, thank u very much.
As it’s C# it is better to do the following :
gameObject.Find("AOB").GetComponent<UnityEngine.UI.Text>().text
Either will work but I’m told this is marginally faster