Hi Penny,
There’s not really enough information here to help you with the animation issues, but regarding the stars, looking purely at the code you’ve given, the only value stars
should have right now would be 100, as it isn’t being set anywhere else in your code to a different value and then the starText reference just gets continuously updated.
As a complete guess, being that you stated the value is 999, that sounds to me like a value you have set in the Inspector for the text component on the UI Text GameObject. If this isn’t changing to 100 which this script should make it do, I would suggest perhaps you’ve not added this script as a component to the UI Text GameObject in question.
Really quick/easy way to test the theory, in your Start
method, add a line at the top of it like this;
Debug.Log("StarsDisplay script is currently attached to : " + gameObject.name);
When your game runs, if this script is attached to a GameObject the console will display this message and the name of which GameObject it is attached to. If you don’t see the message at all, you’ve not attached the script.
You could also right-click on the script within Assets and then use the Find References in Scene option, this will then filter the Hierarchy to show only relevant GameObjects that either have the script attached, or are associated with it in some way (like a wired up OnClick
event for a button etc).
Hope this helps