I need to start an animation in a widget when I press a key, but only when certain conditions met (variables in player BP etc.). I tried to do this with an interface, but it doesn’t work at all.
What about converting the animation into a montage and using “PlayMontage” instead of “Play Animation Forward”? Usually from the char BP side it’s going to be a montage.
That’s mainly because you do not have the target for the event.
The one I usually use when it comes to this: is when you create the widget inside the player blueprint, you can promote it to a variable. This will make a hard reference to your specific widget class. Then use this variable to call the particular function inside your widget class.
Its just bad coding.
You cant play stuff without checking that it exists and can be loaded and you can’t fire off commands to something you aren’t sure exists and is loaded.
Gate stuff off - but not excessively - with isvalid?