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.
Sunday, April 30, 2017
Level Streaming in Unreal Engine 4
Level streaming is a good way to keep your game file size down. It allows you to combine two different levels by loading and unloading the levels instead of having the two levels in one. Let me explain how this works, and how to do this.
1. You will need to make sure your have two different levels already made in Unreal. You will also want to make a new level that is blank. This will be used to combine the two different levels. To add a new level simply click file near the top of the engine and click new level.
Make sure you choose empty level.
2. You will now need to click on window which is near the top like file. You want to then click on levels.
This window should now show up. To stream your level click levels near the top and click add existing. Find the levels where ever you put them.
3. Your levels should now be properly combined. You can now make adjustments to lighting, and make player starts. You will need to add a trigger box for the player to move between the levels. To find the box trigger look to the left of the screen you should be on modes and see basic, to the right of that you should see box trigger. Click and drag that into your level. Make sure you are doing this in the persistent level.
4. You will now need to make the trigger box actually do something. Near the top of the screen, click on blueprints and go to open level blueprint.
Once you are in the level blueprint print just copy what I have below and compile and save. You should now be able to move from one level to the next. If you go to a level and want to go back to the other level you will need another trigger box and make that allow you to go to the other level.
You now have successfully learned how to level stream. I hope this tutorial has been a big help.
1. You will need to make sure your have two different levels already made in Unreal. You will also want to make a new level that is blank. This will be used to combine the two different levels. To add a new level simply click file near the top of the engine and click new level.
Make sure you choose empty level.
2. You will now need to click on window which is near the top like file. You want to then click on levels.
This window should now show up. To stream your level click levels near the top and click add existing. Find the levels where ever you put them.
3. Your levels should now be properly combined. You can now make adjustments to lighting, and make player starts. You will need to add a trigger box for the player to move between the levels. To find the box trigger look to the left of the screen you should be on modes and see basic, to the right of that you should see box trigger. Click and drag that into your level. Make sure you are doing this in the persistent level.
4. You will now need to make the trigger box actually do something. Near the top of the screen, click on blueprints and go to open level blueprint.
Once you are in the level blueprint print just copy what I have below and compile and save. You should now be able to move from one level to the next. If you go to a level and want to go back to the other level you will need another trigger box and make that allow you to go to the other level.
You now have successfully learned how to level stream. I hope this tutorial has been a big help.
Wednesday, April 19, 2017
How to create a menu system in Unreal Engine 4
Step 1:
To start load up the Unreal engine and either make a new project or continue one you have already started. When you get to the screen shown below, click on the green add new button. From there you will see a UI drop down and from there select widget blueprint. It will now open a new tab.
Step 2:
When you get to this screen you will need to add the buttons that are shown. To make these buttons, on the left hand side of the screen press and drag button into the work space. If you want text simply drag text into the button on the hierarchy underneath the palette where you found the button. If you click on the button, you will get a bunch of options on the right hand side of the screen. This is the details section. You can change normal, pressed, and hovered options of the button. You can also change the size of the button and the anchor of the button, For me I placed the anchor in the middle of the screen because that is where my buttons are located.
Step 3:
To make the button do something scroll down on the details section and the right until you find events. For this you want on released, so click on that and it will open another tab. You will now see your on released button. From that red button click and drag the white triangle to the right and let go. You now need to search for open level. Remember this is for a start game button. For the level name make sure you type in the exact name of the level you want to open. Press compile toward the top of the screen and also save. Now go back to the screen we started on.
Step 4:
When you are back at the screen we started on, towards the top click on blueprint and go to open level blueprint. From there copy what I have in the picture below. Make sure your start button is chosen, and the box is check on the set.
You have now created your own menu system.
Saturday, April 15, 2017
Importing assets to Unity from the store, and exporting to Unreal
I recently had to find 3d models for a game me and my group in a game design class were working on. One of my group members mentioned I look on the Unity asset store for 3d models. So I took a look and found plenty of quality made models.
It is very easy to find anything you want, and even find things that are free. So once you find what you are looking for you simply click on the asset and when you are on that assets page, you click the add to downloads button if it's free or add to cart if it is not. You will need a Unity account to download these assets which is free and also you will need a version of Unity installed on your computer which is also free.
After you download the asset you can go into Unity and view your asset. After this you now need to go find the folder that has your assets. I found mine in my documents folder under what I named my Unity project. All you have to do is copy the fbx and paste it into your content folder in your Unreal project if you have one.
Once all that is done just open Unreal and the asset should be in your content browser. Importing and exporting from Unity and Unreal is very easy as you can see. This makes it very easy for people to make their own game.
Subscribe to:
Comments (Atom)























