Have Attribute UI modify a shader, not an image

ronangalbraithcode 2 months ago in Stats updated by Marti (Lead Developer) 2 months ago 1

We are using the "Health Orbs" package from Unity Asset Store to display Player's Attribute: Health. 


The way you make the orb fill up or drain with health is by modifying PositionUV_Y_1 on a shader (called Health 6 in our example). 

We can't figure out how to make the stat script modify this value. The closest we've come is having Value Scale Y modifying the entire image, but this makes the orb shrink, instead of reducing the apparent volume of red liquid inside the orb. 

Is there any way of having the Stats script modify shader properties? Or any workarounds using Unity's Event System?



Unity version:
Game Creator version:

If you know a bit of coding, you can create an Action that allows to set the values of this package based on some stat or variable value. Unfortunately, I do not own this package so I can't be of much more help.