-

How To Create A HUD Animation For A Pick up Item Unreal Engine 4

How To Create A HUD Animation For A Pick up Item Unreal Engine 4, learn to create and script an animation.If you do not have a Pick up Item and you want to create one, here is an article written by me on how to do that - How To Create Pick up Items With HUD Notification Unreal Engine 4

The animation that you will create with this article, will consist of a image widget with a +1 text in it, the image will appear on the screen from the left side and after a couple of seconds will disappear. I will use the default white background for the image widget, if you want, you can upload and add your own custom image in the Details panel > Appearance > Brush > Image. We will work with the HUD Blueprint and the Pick up Item Blueprint.

First, open the HUD Blueprint, drag from Palette and image widget and a text widget,drop them into Hierarchy > Canvas Panel. In the following lines, I will provide what changes you need to make in the Details panel for each newly added widget.

-image widget: next to Position X type 200 - next to Position Y type 200 - next to Size X 200 - next to Size Y 100

-text widget: next to Position X type 200 - next to Position Y type 200 - next to Size X 200 - next to Size Y 100 - Content > Text > replace Text Block text with +1 - Appearance > Color and Opacity > double click the Tint bar and type 000000FF in the HEX sRGB box - Appearance > Font > in the font size box type 48 - Appearance > Justification > select Align Text Center

Next, in the Animation panel, press the green +Animation button to add a new animation, select the newly created animation to open the Timeline, in the Timeline panel, press the +Track button > All Named Widgets > select the image widget and the text widget.

Now, select the image widget Track, press the +Track button > select Transform, with the Timeline set at 0.00 seconds add a key for the Translation track and set it at -450 on the X axis, after, move the time on the Timeline at 0.5 seconds and add a new key for the Translation track and set it at 0 on the X axis, move the time on the Timeline at 1 second, add a new key for the Translation track and set it at 100 on the X axis, move the time on the Timeline at 2 seconds add a key for the Translation track and set it at -450 on the X axis. Now, do the same for the text widget.

With the image widget Track selected, press the +Track button > select Visibility, with the Timeline set at 0.00 seconds add a key for the Visibility track, set to Hidden, next, move the time on the Timeline at 0.1 seconds and add a new key for the Visibility track, set to Visible. Now, do the same for the text widget.

The HUD animation is ready, all we have to do is to script the animation to start when the Pick up Item is collected by the character. To do that, open the Pick up Item Blueprint, go to the Graph editing mode, drag of the Cast To As pin of the Cast To node (set to the Character Blueprint) to add a HUD reference variable, drag of the HUD reference variable to add a reference of the newly created animation, of the newly created animation reference drag to add a Play Animation node, connect the HUD reference variable with the In Animation pin of the Play Animation node, connect the Additems Function node with the Play Animation node, Compile and Save, then close the Blueprint.

Important the Additems Function node is the name of the function that I have created in my tutorial - How To Create Pick up Items With HUD Notification Unreal Engine 4 - the function was created in my Character Blueprint to be used with the Pick up Item Blueprint when we want to add pick up items to the count.

Congratulations! You have created A HUD Animation For A Pick up Item in Unreal Engine 4 - if you have questions or you need additional help, contact me by posting a comment in the comment section below or through the contact page.

Additional stuff - Add sound every time the animation is showed / when the pick up item is collected

Between the Additems Function node and Play Animation node, add the following string, Play Sound at Location (select a sound, if you have none you need to import a sound), add a Get Actor Location node and connect it with the Location pin of the Play Sound at Location node, to complete the string add a Destroy Actor node at the end, then connect the entire thing, Compile and Save, then close the Blueprint.

Interesting articles to read on Edvog.com
Unreal Engine 4 Beginner's Guide
Unreal Engine 4 Tutorials & How To's (With Pictures & Video)
Blender 3D Beginner's Guide
GIMP Beginner's Guide

About Edvog.com - Courses, How To's, Tutorials, Articles & Resources - Games, Music, Videos, Education, Information, Health, Medicine & Research

My name is Andrei Ionita, I am the creator and owner of edvog.com website, I am also the creator and owner of all of the products associated with it, such as: games, music, videos and more... I like to write articles about everything I find interesting in this world, most of the time I write educational articles, but you may also find articles without a main topic. The entire content found on this website is fact checked and original, when I post something, I try to double check all the information provided against all the reliable and trustworthy sources that I can find. On this website you may find content about medicine, the purpose of this type of content is simply informational and is not intended to be a substitute for professional medical advice, for questions you may have regarding your health, always seek the guidance of your doctor or other qualified health professional.

About entertainment and media - Beside, being a website owner and content writer, I'm also a game developer, music producer and video creator. I create, video games, music, animations, photos and more, this is why, from time to time, I will also post content about entertainment and media industry (a broad terminology, just to cover everything in the category). If you like platformer or runner games, you can check out the games made by me on Steam and on Google Play. If you like Relaxing, Ambient, Chill-out, Lounge, Electronic or Trap music you can check out my Youtube channel, Spotify profile, iTunes profile, Google Play Music profile, etc. Who knows? Maybe your next favorite game or song will be created by me :) If you want to support my work, you can play the games created by me, listen to my music and/or Make A PayPal Donation, whatever form of support you will choose, I thank you and wish you a nice day!

Edvog.com / Andrei Ionita on the internet

YoutubeGoogle PlaySteamAI Edvog on SpotifyAI Edvog on Google Play MusicAI Edvog on iTunesAI Edvog on SoundCloudSupport My Work Make A PayPal Donation

Comments