0
Answered

Attributes text fields - what is their purpose?

markusrgb 3 months ago in Stats updated by Marti (Lead Developer) 3 months ago 5

Hello, everyone,

someone can explain to me what these text and icon fields are for. No matter where and what I insert there, I don't see any place where they will be displayed to me. Do these fields have any meaning at all?

Unity version:
2019.4.0f1
Game Creator version:
1.1.9

Answer

+1
Answer

This is to dynamically update UI elements that you have created on your canvas.




Here is how I have that in use on a small test scene:
The attribute is called "stamina", so my UI text updates to "Stamina" (on top of the green bar).
The value scale x is the green bar game object.
The value text is the 100/100 text game object.

All of these update at runtime when my stamina gets changed by actions and so on.

If you download the stats examples, you can see these set up for a health bar and mana bar as well.

+1
Answer

This is to dynamically update UI elements that you have created on your canvas.




Here is how I have that in use on a small test scene:
The attribute is called "stamina", so my UI text updates to "Stamina" (on top of the green bar).
The value scale x is the green bar game object.
The value text is the 100/100 text game object.

All of these update at runtime when my stamina gets changed by actions and so on.

If you download the stats examples, you can see these set up for a health bar and mana bar as well.

Okay, thanks for your help,

I have tested it again now and also took a closer look at the examples.

Basically I am doing everything right.

It works e.g. with the player without problems.

But if I use a global variable that can change during the game, it doesn't work anymore.

I tried to create a display that shows me the HP values and the name of the enemy near me on the UI.

Unfortunately this method does not seem to work!

Unfortunately I can't find any other way to do this either.

...

I think RVR has a tutorial on exactly this, you might wanna check it out:

Hello Phazorknigh, 


unfortunately RVR uses only a static character as described above. 

Also, in his example, each character has its own display hovering above the head. 


I had thought about that in the beginning, but unfortunately it doesn't fit to my game.

But I only need one single display in my UI which can show the opponent's life points depending on the one who is near me.

Answered

I'm closing this thread, since the first question has been answered. If you want to dynamically change the Attribute UI target, you can do so using a Local Variable and setting it to pick a Game Object target from that.

When you change the value of the Local Variable, it will also change the values displayed in the UI.