Play an Animation on a SkeletalMeshActor on Widget button click

Hello,

I now searched the web for 2 hours straight and watched quite a few tutorials but didn’t unterstand how I’m supposed to start an animation on a SkeletalMeshActor when I click on a Gui Button.

The animations are imported and they work when I set the Animation Mode to Use Animation Asset , but that’s not what I want.

I tried to use Events, but I don’t grasp how they work in the blueprint mode.

shame bump

in your character, create the widget and store it as a variable. if its made somewhere else, send it to your character and store it as a variable. in the widget, make a new dispatcher. In your buttons click event, call that dispatcher.

Back in your character blueprint, make a custom event called PlayAnimation. in event begin play,drag in your variable for the widget, drag out the blue pin and search for bind, click the one for thedispatcher you just made. plug the red pin from PlayAnimation into the bind.

Now when you click the button it will call that event.

in the PlayAnimation event, drag in your skeletal mesh, drag out the blue pin and search for get anim instance, then drag that out and search for MontagePlay. choose the montage animation you want to play.

if you dont know how montages work, do some reasearch theyre pretty easy to set up.