Just a quick post today explaining how to play a sound. For this instance I will be adding a gun fire sound so that every time the player presses the shoot button you hire a gun fire sound. To start you will need to find your own sound or if you are using the first person template UE4 already has a gun sound. Let's use a sound outside of UE4. Once you have downloaded or have a sound, and make sure that it is a wav file, you can import it into UE4. If you are in the editor there is a import button, simply press that and choose your wav file. Once the file is in UE4 open up the third or first person character blueprint. Once you are in the blueprint editor, right click anywhere on the grid and type in play sound at location. In that there will be a drop down, choose whatever the name of the wav file is. There is also a yellow pin, drag the pin out and type in get actor location. Now you have all you need for the sound to be heard in the game.
Sunday, May 14, 2017
Saturday, May 6, 2017
Creating AI in Unreal Engine 4
Creating AI in UE4 is easier then you may think. In fact let me show you just how easy it is.
1. The first thing you will need to do is create a new actor. You can either create a brand new actor or copy a model you want to be the actor. To add a new actor simply click add new near the bottom left of the editor, and then choose blueprint class. You can either choose actor or character, but for now choose character and name this enemy or anything that you see fit. After you choose character a new window will open. For you there may be nothing so you will have make your own mesh or import something you already have. Also be sure to add a box collision in front of the mesh, this will allow the character to do damage. To add a box collision simply click on add component and look for box collision.
1. The first thing you will need to do is create a new actor. You can either create a brand new actor or copy a model you want to be the actor. To add a new actor simply click add new near the bottom left of the editor, and then choose blueprint class. You can either choose actor or character, but for now choose character and name this enemy or anything that you see fit. After you choose character a new window will open. For you there may be nothing so you will have make your own mesh or import something you already have. Also be sure to add a box collision in front of the mesh, this will allow the character to do damage. To add a box collision simply click on add component and look for box collision.
2. Once you have a mesh for your enemy, you now have to make it do something. To do this click on event graph. Simply follow what I have put down. You will need to make a variable for is attacking. To do this simply click on the plus next to variable. This will create a new variable, make sure it is a Boolean, and be sure to name it is attacking. As a stated at the beginning creating AI is very easy. If you want the player character to take damage, that is also very easy to do.
3. You want to make sure you are in the player characters blueprint. Again simply follow what I have, you will need to create a variable for health by again clicking the plus. For this make sure the variable is a float.
4. If you have followed everything, the enemy you created should chase after the player character and if they get close enough should be able to do damage.
Subscribe to:
Comments (Atom)





