Download

noob animating UMG q

Hi guys!

I’ve been trying to fully animate and main menu but something is wrong with it, where even before any input from the user the animation will be set to the end already when I test play it.

I have the main menu as a separate level to keep things clean, with the level blueprint as:

I used the tut here (4. Scripting the Main Menu | Unreal Engine Documentation) to make it.

the widget animation looks like this:

It’s pretty simple anim, based on opacity and movement, to start based on a “OnClicked” event.
And this is how it looks when I play it, without clicking on anything at all:

played.jpg

I’d appreciate any thoughts.
Cheers!

If I get it right, the issue is that upon level start the animated object is already at the end of its animation, right?
If so, I had the same problem. When I started the anim, it popped to the beginning and played it nice. To get around it, I just added a (in my case) position node at the event begin play to set the object to its idle location (my anim was that an object moved to the side).

Also, you will need to use the play animation function, but I bet you know that(to start it).

Hi Agiro, thank you for your idea, but I don’t see a way to make that work.
On my widget blueprint it’s not possible to add and a event begin play, only on the level blueprint. Can you clarify please?

And yes, when I start the level the animation is already at the end.

Any other ideas? I’m reallt bumping my head against the wall on this :confused:
Cheers

Greetings,
You don’t have an Event Begin Play, or you already have this and that connected to it?
If the former, you can create one. If the latter, so you have a list of functions and whatnots dragged out of it, just add it to the end, and connect the execute wire (the white one).
This connecting up works just like giving another line of code and they end at the end of the line.
EDIT: IMPORTANT CORRECTION @tiago.delgrossi
At the widget blueprint there is an event construct. Use that, sorry for the misleading. By the way, you can add it to the event begin play of the level blueprint as well, but then you will need a reference of the widget variable. Just make the thing you wish to animate a variable (details panel, somewhere up right) and you can get it by dragging from the reference of the widget in the level BP (a blue slot) and use the command get, where the asset-to-be-animated shows up if you start typing its name. Then you can change its parameters that are being keyed.

@Agiro, sorry for my stupidity, but still no success. I can’t seem to call a position node from the Event Construct:

9c3419a489c519a85df48f10b356ca04028888d3.jpeg

And here’s my animation sequence in case there’s something wrong with it:

Thank you very much for you help!
Cheers

It ain’t stupidity, we all started somewhere and I’m not an expert either.
Try calling the set render transform, that works fine for widget elements. In my case, as I used anchors and a scalebox as well, I just needed to set it to zero.
By the way I did it in the level BP.

I needed to adjust its location. If you need to adjust the scale, rotation etc you call the Set Render Transform.
A scaleboy is used by right click on the component at the Designer view in the Hierarchy panel, and wrap with scalebox. It is perfect for keeping your images and whatnot’s aspect ratio. As for anchors, using them is a must. They are straightforward, they tell you from where does the engine positions your UI elements.

@Agiro, if I understood correctly your whole widget would move to a certain position when the animation started, like a in-game menu right? Mine is a main menu the occupies the whole screen, where the moving animation is for a button only… so I believe that the solution you offered won’t apply here.

It feels odd, doesn’t makes any sense that an animation starts without even being called!

Thoughts? Cheers.

Not the whole widget, just the slider element. I used the naming “widget” at the beginning of these so I know they are widget elements.
My widget slider is just an image. It is animated so at the end of the game it slides to the right, as if something is opening.
It works exactly the same way for buttons as well.
On the first image I have a basic setup with a button. You also see an animation to the lower left, named ButtonANIM.
The other image shows the end of the animation.
On the Level BP you see a basic setup for calling that animation. In case it gives you trouble, you can use the last image’s setup by telling the button where to begin. The animation can be called anytime, but the button’s forcing to its pos must be at the beginning.



117007f05f5e5261a4d3f36038a7f50d2f12f9b0.jpeg
3c083b73ea73f16c131dbe7475f0602e419b5de6.jpeg

@agiro you’re being very helpful, I appreciate that, but it still doesn’t work.
Using exactly the same workflow that you did, it will start the animation from zero when the level play, instead of just display the end of the animation like before.
But that is not what I want, I want the animation to start only when a certain button is clicked, so I tried to call OnClicked within the level blueprint, to no success:

99c3d009297f712ba9a5be01d47f1f9e24d9d798.jpeg

Are we overseeing something important? Do I have to do something in the animation other than just set the frames and values?

I don’t think a bind is necessary here, however your question was regarding the animation, not on button usage so I did not mess with that.
It worked for me when I put the button action only on the widget.
If it starts the animation from zero, it means the original issue is solved.

b344ffac95bfbd901324d76d329b7d508afd3c8f.jpeg

@agiro, yeah sorry I should have been more clear with my question :slight_smile:

And you just described exactly what my firsts blueprints looked like, which did not worked for me! I think I may have done something wrong without noticing it, so I’ll try to achieve the same in a blank file to see the results.
Thanks for all the help!

Hope I helped at least a bit. What is strange that the solution I posted was tested and it worked for me.
All in all the theory is that you need to define its idle location at the beginning.

@agiro guess what… just figure out! The issue was that I was assigning the values for the animation (ex: opacity of zero) in the details panels, then hitting the “add keyframe” …
For some sign of the universe I tried to do the other way around, by first creating the keyframe in the animation editor, than changing the values within, not using at all the details panel.

uush, this took me 3 days to figure out… although this may be obvious for some, it would be very helpful it was more explicit in the help tutorials.

Cheers and thanks for your help, certainly learned some tricks here!

Glad you made through it and even more glad that I could be of assistance :cool: