Hello there.
I have an animated image sequence i want to use on the UI to wipe away a level at the end of a cutscene so that all i am left with is an image.
So it plays a matinee cutscene, then 4 seconds from the end i want this animated image sequence to start, after 4 seconds the sequence has finished and a new level loads with a static image of the UI.
The problem i am having is that the animation isn’t starting from the beginning when i use level blueprint to launch it, it is always part way through when it launches.
Any help on this would be greatly appreciated, or even if i am going about this entirely the wrong way.
All i would like is my 4 second animation sequence to play form the start on the UI for the last 4 second of the cut-scene.
See image attached for the material setup i have that i have linked to an image in UMG
Thanks
Hey, does this ever stop animating? Not familiar with flipbooks or 2d workflow but logically I wonder if you can expose the time multiplier and set to default 0. Then when your motion starts set it to .22?
No, although there is technically an end to the animation, it just loops endlessly and im not sure of another way to drive it where it works in UMG. The solution i have to this at the moment is that after a timeline node in the level blueprint i have the animation element replaced with a static image element of the last frame of the animation.
I did try using a material parameter collection to drive the starting point of the animation using the multipler node, basically had a default value of 0 then after a timeline node in the level blueprint i have the value change to 0.22, this raised two problems:
-
UMG doesn’t seem to recognize any changes using the material parameter node, because as soon as i used a value linked to a material parameter collection the UI element didn’t load when pressing play. I tested to see if the material parameter was broken/incorrect by applying the same material to an object in the scene (cube) and it was working as intended, animation was paused until the value changed to 0.22, however this raised problem number 2
-
The animation still isn’t starting from the beginning of the animation when the value changes, i believe because of the time node that even though the animation is paused, it is playing in the background and retaining what frame it should be, so that when the value changed from 0 - 0.22 its jumping to the frame it thinks it should be at instead of from the beginning
Hope all of that makes sense
thanks
Hey Simon,
Had a look at this last night. I set up a test project on 4.10.x first person template and am pretty sure I was able to reproduce and remedy problems 1 and 2.
My test was an image on a canvas panel in a widget blueprint created and added to viewport by the HUD class set in the gamemode (this was just the setup that came together in a few minutes, not done this way purposefully by design but it was fine).
Once I had everything set up in a way that made sense to me and I hit PIE and got nothing. Looking at the widget I had a red box under the brush binding in the details on the designer complaining that my material was not in the UI domain and offering to fix it. I clicked fix and was treated to my animation in… silhouette. I needed to go back into the material and drive it’s emissive colour with the flipbook and hey presto, UI loads with flipbooks running glorious technicolour in UMG.
Following a bit of reading I realized a couple of things - the time node has a purpose but this aint it. I also realized that the Animation Phase takes a scalar that represents the frame position of the animation as a percentage of the total frames. So I used a 4 frame test animation meaning that each frame was .25 from the previous one. With that in mind I created a scalar parameter to drive the progression and replaced the time node with it.
In order to get this to play nice I had to create an instance of the material. In the widget blueprint off of event beginplay (I think, will double check later) I created a dynamic material instance from my material and set this as a variable. In my brush binding I bound the dynamic material variable (with make brush). From there I went back into the event graph on the widget and used tick with the ‘set scalar parameter’ node on the material variable and again success.
I wonder if you’re creating the dynamic material at the right point, i.e. before you try to bind it. Sounds silly but I remember having trouble setting the material just before creating the brush (maybe that’s just me doing something stopid) moving that into the event graph allowed me to change the value of the scalar parameter, happy days.
Setting up this way I could determine and change which frame of the animation I was on. All that remains is to increment the frame from blueprint when appropriate.
Let me know if this doesn’t make sense and I will try to help but I don’t have my test project with me so I may only get to it tonight.