How to control a rotation

Hey everyone, I’m working on our HUD, and I’ve got a mask that rotates for health/energy, however I can’t figure out how to control it based on the current % of health. I’ve got two parameters coming into the material (current health, max health) but aside from that, and the addition of the mask and the rotator, it otherwise looks like the content example bar is what it looks like, and i’ve tried connecting everything from divide on as well as the current texcoord to try to get it to work. I don’t think i need a “time” value, unless it’s possible to plug a function into that (which i haven’t figure out how, if it can be) that would trigger when the character takes damage

So, within my function that’s actually drawing the element, i set up the division that determines the current health %, set that as the parameter value on the scalar, and plug that scalar into the material?

Edit: I’m still getting something wrong. I’ve got this, now, in the calling function. The material is the same, except the added health param to time. With or without something plugged into coord, the result though remains the same. Thanks for the help! Edit, sorry for the double pic, it doesn’t seem to want to let me to remove one though

You’ll need to plug a scalar parameter into the Time input on the rotator (by default it uses time) and set the rotation to be some value over 0;

In your blueprint/code you can then lerp between appropriate values of the scalar parameter based on the health amount. Lemme know if that doesn’t make sense.

I made a quick example setup, i figure that would be easiest to express what i was thinking. Hopefully it will post on here fine, otherwise i can email it.link text

I think you forgot the materials, I’m getting these errors when i load the level: Error /Game/RadialMat/TestRadialMat :

Can't find file for asset. /Game/Shapes/Shape_Cube
Info Failed to load /Game/Shapes/Shape_Cube.Shape_Cube Referenced by RadialExample_BP_C_0 Property /Script/Engine.StaticMeshComponent:StaticMesh
Info Failed to load /Game/Shapes/Shape_Cube.Shape_Cube Referenced by RadialExample_BP_C_4 Property /Script/Engine.StaticMeshComponent:StaticMesh
Info Failed to load /Game/Shapes/Shape_Cube.Shape_Cube Referenced by RadialExample_BP_C_5 Property /Script/Engine.StaticMeshComponent:StaticMesh

edit: never mind, it’s not loading something but i found the materials.
Working on intergrating it into our material now

Be sure the files are in Content/RadialMat folder. It wont find the links properly otherwise

They were, i just extracted and copied the whole thing over, but it wasn’t finding the base shapes/materials for whatever reason. I think i got enough from it though, i really appreciate it. The only thing left is to figure out how to get the opposite mask to work. Right now, the material is just rotating around the circle. Here’s a pic of where i’m at, and the result, please guide me oh helpful wise one!:

9809-result.jpg

Ok, so many thanks to RimmyD for getting me kickstarted on this. I think I trimmed it down a bit compared to what he had, and where I started.The red block is purely the rotation taken directly from Rimmy’s example, with the exception that i did the dividing of health/max health in the material, instead of in the calling blueprint. The only difference there is you need two set scalar parameters in the main BP.

In my case the masks were drawn on the red channel on my texture, so thats why those get multiplied together. Any other questions feel free to ask.

Glad it’s all workin!