Anyone knows how to create a widget and be set above a character’s head, not in the viewport? I made a surprise icon animation in After Effects, made a ContactSheet in Nuke and import the image to make a material of that animation. I want to play that icon animation when a character gets startled, but don’t know the proper way of doing it. I can set a widget component in the charcater’s Blueprint and use visible nodes, but it won’t restart the animation and the new visibility may start in the middle or end of the animation.
Honestly using a widget component in the parent NPC Actor Blueprint is the best way that I know of. Why do you not want to use a component in the viewport of the blueprint? It’s simple, low-impact, and can use triggers inherited directly from the child bp. It’s what I use for health bars, damage effects like DOT and HOT displays…and you should be able to just use the Play Animation node, where you can set number of loops to play, speed, forward or reverse, and starting frame.
The thing is that I want the widget to appear above an NPC, not displayed on my screen. It’s more like the counter icons in Batman: Arkham City or the alert icon in MGS3. Guess the best thing would be to do the animation in the widget blueprint and play the animation node.
Hi There,
So you can do that very easy with multiple approaches.
Since you give an example as basis Batman:Arkham City I took a look at them and they are simply in world (not sure what they used)
So what you can do
- You can use just a VFX Niagara and use power of vfx framework. Display multiple animations, billboards and so on. When this is good : If you are not dependent on showing visual information in detail, like cooldown bars that vary, you don’t need to keep visual feedback locked in screen borders of player go with Niagara.
- You can use a Widget Component and use power of UMG if you have strict information about the event, like a word saying “Dazed” etc. Attach a component that you can even render in world space or screen space and you can feed whatever widget needed for that moment, controlled by something (A director). You can even purely use UMG if you want to over engineer it. This is something I callled a
NamePlate_Widgetwhich you can build many things like, icons, names, bars, agro indicators, status indicators and so on. Material framework is pretty strong so if you don’t have over the top visual signs and feedbacks this is the way. - You can go a little bit oldschool mindset and event driven even GAS driven framework. You can create a gameplay cue and effect as character.state.alerted. When this tag is added runs a gameplay CUE, that simply attaches to a specific head socket in meshes and does its own thing, which without using any of the above framework, spawns a billboard and adds a animated material on it.
There could be mix of match of many things. If you are going to expand AI states and there will be many states, information etc. go with UMG. If you don’t have much states and representation really “matters” go with niagara.
Here is a tutorial / stream about nameplates that is more RPG. There are many more still beware not all of them are extendable however this stream example should be.
Let me know if its helpfull.
Hey! Thanks for answering. Now I want to try them all haha Guess I will go with Niagara, since I just want to represent 1 state for my prototype. Although I’m really interested in trying your UMG solution.
If you are experimenting go Niagara it would make things more shiny with less effort. UMG can do alot especially with its unique rendering framework however it has a steeper learning curve.
If you are trying, doing 1-10 State feedback go Niagara even that can be even extended a lot if we really really want. It’s just about tradeoffs that you will need to choose eventually.
Try do something like this, I think you will have some fun time with it. Make and attach to a socket of the characters head when needed and destroy.
Man, thanks for sharing that video! I guess it’s just what I needed. It makes the billboard always face the camera so easy. Gonna try it right away.