I am trying to change the value of a UI Text Field so that it takes it's entry from a local variable attached to my enemy prefab. What I want is the enemy name displayed on the "target information" on the UI. I have looked through most of the actions I thought might do this, but I cannot find anything suitable.
I created a local variable component on my enemy character called "EnemyName". I then set that as a string and entered in "Robot". All my enemy prefabs (orcs, trolls, etc) will have the same variable name (i.e. EnemyName) so the target system takes the name from that field.
As I could not directly find a way to make the local variable dynamically populate the UI text field I thought that I could populate a Global Variable with the current target and show that in the UI Text (I found a way to do it static, using the Variable Text script and selecting Local Variable, adding the Game Object as my robot character and then selecting EnemyName as the field, but this would always show "Robot" as the target name regardless of what was selected).
Now I need to find out how to populate the Global Variable with the selected Game Object's local EnemyName variable, and again, I cannot seem to find an action that takes a local variable value and populates a global variable.
Struggling with this atm. Could you assist at all with how you would handle this, please.
Many thanks, Steve
Customer support service by UserEcho