Hi! I’m working on a chat bubble for one of my NPCs in my 2D game, and I have it set so that it plays a little animation of the chat bubble scaling up to size. I’d like my message to show up afterwards. Currently I’m using delays to achieve this, but I think it would be nice and useful if there were an animation end event for UMG animations, like with Paper2D.
You can use iTween to facilitate this. Use a UMG Scale From/To operation, set an object as the OnTweenCompleteTarget and implement the interface, implement the event, and there you go. Once the scale animation completes, the event will be called and will execute your logic.
Alright, I’ve been using iTween for ~10 minutes now, and I really like its potential. Thing is, I have no idea how to do what you told me to do, hehe… I have found other uses for it though, so either way I’m happy, but is there a tutorial on UMG and iTween? I didn’t see one in the playlist linked to from the original post. I got it to scale and everything, all I need is that finished event. Thank you
:'O I love these animations! They’re so much better than what I had before!
(what exactly should the ONTweenCompleteTarget object be?)
Your OnTweenCompleteTarget can be anything. Are you familiar with blueprint interfaces? On the blueprint you want to execute custom logic when the tween completes, add “iTInterface” in the class settings. This can’t be done on the level blueprint since they don’t support interfaces, but any other blueprint is fine, including your widget blueprint that houses the widget you’re tweening. You can just plug “self” in there if the calling blueprint is the same as the one that should execute the “Complete” logic.
After you’ve added the interface, compile and search up “Event On Tween Complete” in the context menu. From there you can run whatever code you need to.
I hope what I said makes sense, feel free to ask for more clarification if not. I’m really glad you like the animations, I encourage you to experiment with the different easetypes!
I do plan to finish a whole suite of videos in time but right now the paying projects take priority, you know how it is
I also would like to have this feature… At the moment I just use a delay node which is called after the Play Animation Node, but this only works in the Event Graph and I have to manually know the animation lenght…
Ahhh, I see. Looking forward to it! (although it’s not much of an issue anymore hahaha) Is there a preview coming around anytime this month, if you don’t mind me asking? :3
Hey Nick, I just checked 4.8 and this still doesn’t seem to be present within the graph? You can get the start and end times but no event from what I can see.
EDIT: At least from what I can see in this project in 4.8.0 (binary), haven’t tried the new 4.8.1 source someone mentioned was live. Just checked, 4.8.1 I guess isn’t live yet.
If its possible, you can restart the animation by playing it again with the loop set to 1, this will make it run once and then stop. Canceling out the infinite loop of the previous time is was started.
If you could fire generic events from UMG animations (like you can in matinee/timeline):
a) you wouldn’t need these extra events
b) you could easily do stuff at certain points during the animation (without having to do a big messy workaround in tick in the Event Graph)
c) Animations would be simpler, a lot less redundancy, less error-prone (for example if you want to hide a whole heap of elements repeatedly in the middle of various animations, you can do it once in blueprint, instead of duplicating the hiding keys through many animations)