Download

Help Request - UMG Animation playing more than once tied to Event Construct

Hey all,

Been stuck on this for too long, and just can’t figure it out.

I made an image to help explain:

Basically, When you pull the Right Trigger on the controller, it sets the Scene Component where the Widget is to visible, which kicks off the Event Construct of the Widget - which plays the animation that moves the crosshair forward from the player.

The problem is that this can only occur once.

Every time I hit Right Trigger afterwards, the widget appears at the end of the animation. As far as I can tell, you can’t re-create widgets, which means I can’t re-play the animation, since it’s tied to the Event Construct. I’ve tried placing the animation to play in Event Tick, but it just doesn’t even work then.

Any ideas, suggestions, help would be much appreciated :cool:

-Thanks

Avoid using constructor like that with widgets hidden as default.

When the widget is created it tries to play the animation but as the widget is flagged as HiddenInGame, the animation is actually paused (if I remember correctly). When you set to Visible (NewHidden0) it simply continues to play the animation that the constructor started. Next time you pull the trigger, the animation has already finished.

Instead, create a *CustomEvent *and make it play the animation on GamePadRightTrigger, regardless of when the widget is spawned. Alternatively, just play the animation itself on GamePadRightTrigger

I don’t think that works. Reason, this UMG is not being added to the viewport/playerscreen - it is instead an actual physical component attached the the character - and therefore the animation can only occur with the Event Construct.

I have no problem playing the UMG animation in a typical manner (i.e. added to the viewport), but the problem with doing it that way is I don’t know how to orient it that it always comes out from the character (following forwardvector)

Either way of doing it would be great, but I couldn’t for the life of me figure out how to get the UMG animation added to viewport to always follow the forwardvector of the character… (because, the crosshair animation moves from ylocation 0 to ylocation -300 - but this is a fixed animation location - I can’t figure out how to get this to start in front of the character and orient towards the forward vector).

This method, at least it follows the forwardvector (since it’s physically attached to a scene component) - but now I run into this problem.

I was thinking - another way to possibly do this is not use an animation at all - but instead move the scene component attached to a playercharacter in real-time while the game is running… I’m not sure if this is even possible?

Anyone know?

If you want to stick to 3d widget:

Create a *CustomEvent *in the widget:

You can access the embedded widget like this:

This will play the animation in the widget component.

If you want a 2d widget follow a forward vector, you need to *ProjectWorldToScreen *and place your widget there.

You should be able to add relative location to the component.

Ok, I will try this tonight :slight_smile: - for some reason it seemed this wasn’t working before, but perhaps I was doing something wrong - thanks for your help!

awesome dude, it works! thanks so much! <3