when i try use this code unity 5.1 : healthtext.guiText.text =“health :” + health;
I’m getting this error but it working on unity 4.6.7
BCE0144: ‘UnityEngine.Component.guiText’ is obsolete. Property guiText has been deprecated. Use GetComponent() instead. (UnityUpgradable)
i tried like this but its not working. anyone get help?
if you pass a string into getcomponent it doesn’t know the type, so it returns a generic “component” type and you then need to cast it. Much better to not use the string parameter and go with the typed version.
also, although it’s not listed I think unityscript supports