Unreal Engine’s Marketplace boasts an extensive array of assets, providing creators with a rich palette to enhance their projects. However, the process of downloading and incorporating these assets into your projects comes with a caveat: the accumulation of data in your Vault cache. As these assets are added to your Vault cache before being imported into specified projects, the cache can grow substantially over time. By default, Unreal Engine deposits these files in your user directory, leading to a potential strain on your primary OS drive’s disk space
How do i do it?
Well its a lot simpler then you may think, Fire up Epic games and click on Unreal engine, the option on the left. It will most likely load to the News tab or the Marketplace tab so at the top change it to Library.
If you have a lot of projects installed you will need to scroll down but you should see a divider and the title says VAULT. Here you will see a filter by option and the right of that will be the amount of space the vault is taking up.
The simplest of solutions would be to remove the vault files you are no longer using unless they are files you share between projects or regularly use for new projects as these files already exist in your project folders. so you can click the yellow drop down arrow and select remove local content.
Below each plugin/ package it will show you the space that it takes up on your drive.
Now, what you have been waiting for. To change the vault cache location select settings on the left and towards the bottom of the new window you will see Edit Vault Cache Location.
A Vault location screen will appear and you can use the Browse button to change the location of the cache, go ahead and click on it.
A windows explorer window will open and you can point it in the direction of where you now want to store it. I suggest a non-primary drive or external drive with sufficient space.
Conclusion
In conclusion, by relocating your Vault cache, you’ve taken a significant step towards optimizing your system’s performance. This simple adjustment frees up precious space on your primary drive, alleviating the burden that once caused your rig to stutter and slow down. No longer will you find yourself perplexed by the ominous red line signaling dwindling disk space. Instead, you can revel in the newfound efficiency and speed of your workflow, unencumbered by storage woes. It’s a small change with a substantial impact, ensuring that you can focus on unleashing your creative vision without the distraction of storage constraints
Having a swimming mechanic will add a lot of volume to any game. In the vast expanse of game design, the inclusion of a swimming mechanic not only expands the horizons of gameplay but also delves into uncharted depths of immersion. By integrating swimming mechanics, game worlds become boundless oceans teeming with exploration opportunities. Imagine traversing expansive bodies of water, uncovering hidden treasures beneath the waves, or embarking on epic underwater quests. The addition of swimming mechanics introduces a dynamic dimension to gameplay, enabling players to access locations that would otherwise be unreachable.
To swim we of course need a body of water to use. So we need to enable the water plugin. Goto Edit > plugins and search water. Enable water (experimental) and then restart the editor.
When it restarts if you see this error make sure you scroll the the left and click on the add entry to Defaultengine.ini – this is important!
Create a basic level > remove the floor > add a basic landscape and enable edit layers.
Now we have our land scape lets add water, go to the quick add > all classes > type water > water body ocean. (or water of your choice)
If you have a problem where you cant see the water or a beach etc, it maybe the position of your waterbody and the landscape. You may need to make sure they overlap by selecting them in the outliner and moving them around and adjusting the height.
Once you can see it lets adjust the area by making a small island, to do this we can adjust the area by clicking and then moving the splines > lets just make a small island.
When we enter the water we can not swim. That’s because we don’t have anything setup to tell it how to work. If you end up walking on top of the water click on the water body in the outliner, select the physics tab and scroll down till you see Collison presents. change this option to WaterBodyCollisions
Setting up the character blueprint
Open the Character blueprint you are using.
Create two custom events called Start swimming and Stop swimming.
Lets create start swimming first, get character movement from the components menu and drag it just below the event.
from the movement node > Get player volume > set water volume > Tick water volume >
Create a new var isSwimming (boolean) > Connect it to the water volume > Tick isSwimming?
From the set swimming > Change movement mode > add character movement > change movement mode to swimming
Copy and paste everything except the event and connect it to the stop swimming. {Untick the water volume and isSwimming? And change movement mode to walking)
Swimming movement.
Next we need to modify the movement input (this is already in the blueprint.)
Find the movement input section of the blueprint and drag the IA_Move node to the left to make some space
We are going to drag in the character movement from the components section > Get movement mode > switch on EMovementMode
Connect IA_move to the Emovementmode. Click on the reveal arrow and Connect walking pin and falling pin to the existing movement blueprint. (you can make a junction/move joint and connect falling there)
Copy and paste the add movement input below the existing one.
Get control rotation > Get forward vector > World orientation (new movement input)
Connect the swimming option from our movementmode to the movement input
Connect the Y axis from the IA_Move to the movement input.
Compile and save.
Setting up the water body.
If we were to test the function of swimming now nothing would really happen as we have yet to tell the game when to start and when to stop the swimming events. To do this we need to go back to the main screen and in the outliner select WaterBodyOcean.
Next to the add button click on the blueprint button and a create blueprint dialog box will open up.
Leave the name if you would like and click on the select button and the blueprint will be created. The blueprint should open. Select event graph and delete event tick.
We now need to add a new event called ActorEndOverlap to get this event you may have to click on the ActorBeginOverlap event already on the blueprint.
ActorBeginOverlap > Cast to BP_ThirdPersonCharacter (or what ever is your character blueprint) > As BP thirdperson > Start swimming.
Repeat this process for the ActorEndOverlap however instead of Start swimming do Stop swimming. Except the event nodes.
while we are here we also should change the collision value other wise when our feet touch the water you will change to swimming animation in mid air. In details search for offset, navigate down to collision and change the collision height offset. Lets start with -70 but you may need to adjust this to your liking.
Compile and save.
If you find the water has disappeared, select one of the spline nodes and move it slightly.
We are now going test this (ignore the animation for now) you will also notice your character is sliding around a lot.
Lets fix it. Open the Character BP and open character movement and search for swimming in the details.
I feel our swim speed was ok, lets change our braking and change it to 150 this is your call what you set it to.
Setting up the Animation Blendspace
In our Main Animations folder Create a new one call swimming and import our swimming animations Swimming and TreadingWater.
Once we have imported the animations we need to make a change to the TreadingWater animation otherwise when we are treading water at the surface the water level will be at the hip height of the character.
Open TreadingWater and on the left hand side menu find transform you may need to expand it.
We want to change the last value which is the Z value of import translation to -50 then at the top click reimport animation you will notice the mannequin shift position. You can change this value depending on your preferences.
Go back a step and create a new animation blendspace and call it ABS_Swimming
Open up ABS_Swimming and Under the Asset details tab find the horizontal axis and change the name to Speed and set the Maximum Axis Value to the speed you set in the blueprint. Default is 300. Also change your grid divisions to 2 and select snap to grid.
Now on the right under asset browser find your Swim idle and drag it to the left side of the time line and then find your Swimming and drag it to the right side of the timeline.
If you hold Left CTRL and move your mouse over the time line the animation should play.
Save and Exit.
Setting up the Animation.
Open animation BP > Main state machine add new state SwimmingLocomotion.
open it > add ABS_Swimming > result > speed > right click and promote to variable
Create a new Var (bool) Swimming. Create transition lines from and to the main locomotion state and transition to will be the swimming Var.
Transition from is get the Var > NOT > Result.
Save.
Goto the event graph and on the Sequence add a new pin. Add a new movement component > get is swimming and set swimming.
We now need to setup how our the engine determines the speed of the character.
From set swimming > Cast to BP_ThirdPersonCharacter.
From thirdperson object > Try Get Pawn Owner
From thirdperson as BP third person character> Get velocity (scroll down find it under transformation) > Vector length > Set speed and connect the cast BP third person to set speed.
Now we need to go into our AnimGraph and add a swimming > not >AND (may need to create this Drag from the NOT and search AND Boolean) > Should Do IKTrace (control rig)
Now when we enter the water the swimming animation should happen, note you may need to go back and adjust the collision to your liking.
You could also setup a few more animations to smooth out the transitions this is up to you.
Conclusion
With the implementation of a swimming mechanic, you’ve unlocked a new realm of possibilities within your game world. Just as the vast oceans hold unexplored territories and hidden treasures, your game now offers players the chance to dive into untold adventures. While your swimming mechanic may require further refinement to align perfectly with your vision, it serves as a solid foundation for bringing your aquatic landscapes to life. Whether it’s navigating through sunken ruins or discovering secret underwater realms, your players will embark on journeys beyond their wildest imagination. Embrace the endless potential of your newfound aquatic frontier, and watch as your game evolves into an immersive experience like no other.
For some strange reason this post is missing some information and screenshots I will need to fix this post
Why?
In Unreal Engine 5, the ability to interact with items is a fundamental aspect of many games. One of the most common interactions is picking up items as our character moves over them. This mechanic not only enriches gameplay but also adds layers of complexity and engagement. Imagine your character collecting coins, gathering resources, or picking up key items essential for progression. By implementing item pickup and counting systems, we can create immersive and rewarding experiences for players, enhancing both the challenge and the satisfaction of the game.
The Process
If the object is a staticmesh you will need to convert it to a BP do so by adding the item into editor and then using the blueprint button convert selection to blueprint.
If the object is a staticmesh you will need to convert it to a BP do so by adding the item into editor and then using the blueprint button convert selection to blueprint.
Edit the added object blueprint from the world outliner.
Once in the editor open viewport and you will need to add a collider. (which one depends on the item)
Now rescale the collider to match the item
Next scroll down in the right menu and find events. Select on component begin overlap
In the editor cast the event to the character. If using the 3rd person template cast to ThirdPersonCharacter and add other actor from the event into the object of the cast then to show the item has been picked up connect the cast to a DestroyActor (don’t forget to compile)
Create a counter for the item
What good is an item if we do not know what we have, or how many we have picked up? Lets create a simple counter.
First open up your Character Blueprint (First person/ 3rd person/ top down)
Select viewport from the top tab and then create an overlap event from the details menu (on the right)
The event will be triggered by the coin actor with a Cast to “object name”, we will also create a Variable as an integer and call it TotalCoinItems and specify the default value will be 0. We will the Set the value by dragging off the cast and getting our variable and adding 1 and connect it to our set
To add a counter to the screen you will need to add a GUI widget and bind a text box and use the following code
Conclusion
This is how we are able to interact with items on a basic level and have a counter on the screen showing the amount of items we have picked up.
For some strange reason this post is missing some information and screenshots I will need to fix this post
The crouch. One of humanity’s most basic movements. Humans have been crouching since they figured out that going under things doesn’t always require us to crawl. Sometimes in games we need to duck under objects or sneak past enemies so this mechanic can be very versatile and we can build many different game mechanics into it as an example some of these could be to improve accuracy when shooting / Snipping, to reduce the characters detection rate when sneaking some games have even used crouching jump combination to reach higher platforms. All in all it can be a very useful thing to have in your game.
Resources
Provided Crouching Animations converted from Mixamo
Since 5.3.1 released we do action mapping a little bit different, no long are we going into your project settings and mapping from there. Now we are adding an Input action and adding that to a IMC (you can have multiple of these)
Now we are going to create a new input. Navigate to Content>Thirdperson>input>Actions. Right click and go to input and select input action and name it IA_Crouch. Once created open it and leave all the options as default and click save and close it.
Now we need to add it to our input mapping context, should be in the previous folder. Its call IMC_Default, open this up so we can add our mapping.
Use the plus button and from the drop down select our IA we just created and bind it to the Left CTRL key and make sure you save.
For our next step we are going to open our character Blue print (ThirdpersonBP) and setup the blue print for crouching.
Left click and search and add the action map we just created IA_Crouch and click on its expand arrow. Drag from the Started pin and search for and add the crouch function. From the completed pin add Un Crouched.
Select the Character Movement in the components tab on the top left and search for crouch.
Here we are going to click on the option at the bottom called can crouch.
We can also change our crouch speed as well as our height. The height options changes our collision capsule so we can fit under objects or landscaping you can change this if you wish. This wont make your actor animate into a crouch yet it will just reduce the size of the collision capsule. If you decide to test it at this point all you will see is the camera move. (You can also make the collision capsule Visible to test also)
Another thing that you can do at this point is that If you feel the camera movement isn’t smooth enough you are able to enable camera lag. What this will do is smooth-en the camera movement when you toggle the crouch. In order to do this select camera boom in the components tab then search for lag in the details tab and enable camera lag
Animation configuration.
Next we are going to setup the animation, we need to import the animations that are compressed in the CrouchAnim.zip file. You can click and drag or add them how you see fit. Create a folder under content call it Animation (Can add a subfolder if you wish) and add them here. You will be prompted with a FBX import options, target the SK_Mannequin skeleton and import all. Once done you should see all Five animations imported. (We are only going to use two for now, however having the others there will be good for future use)
Before we setup the blend space we need to modify the CrouchedWalking Animation to stop it repeating so open it up and on the left under asset Details we are going to enable two options EnableRootMotion and Force Root Lock
Now we are going to setup our animation blend space. To do so right click in your animations folder and goto Animations>Legacy>Blendspace 1D and select the sk_manequin and call it ABS_Crouch
Open up ABS_Crouch and Under the Asset details tab find the horizontal axis and change the name to Speed and set the Maximum Axis Value to the speed you set in the blueprint. Default is 300. Also change your grid divisions to 2 and select snap to grid.
Now on the right under asset browser find your crouch idle and drag it to the left side of the time line and then find your Crouchedwalking and drag it to the right side of the timeline.
If you hold Left CTRL and move your mouse over the time line the animation should play.
Save and Exit.
Configuring the AnimGraph in the character BP
In the content browser navigate to Content>Characters>manneqiuns>Animations and select the ABP_Manny. (this also works with custom characters.)
Find the Sequence node in the middle of the current screen and select add pin, next either get the movement component or copy and paste it from one of the existing one’s on the screen. Drag from the pin on the new movement node and add is crouching. Right click the return value and promote it to a variable and call it isCrouching? Now connect the Set to the new pin you created earlier.
Now goto the eventgraph tab in the top middle and when it is open access the AnimGraph this should be a tab in the middle top section of the screen and open up the locomotion state machine. You should see something like this
Create a new state machine and call it Crouched drag off the pin and create a new Cache pose and call it crouched.
Open the Crouched State machine and add a new state from the entry and call it crouched locomotion.
Open Crouched locomotion and add in our ABS_Crouch animation from the asset browser to the right and connect it to the result. Then from the speed pin drag it out and get ground speed.
Go back to the main AnimGraph page and open up Main States State machine. Add a new state and call it Crouched Locomotion and connect it to locomotion and back (this can be tricky at first, try dragging from the border)
Click on the locomotion to crouched locomotion. Add the variable isCrouching? And connected it to the result.
Now do the same for Crouched locomotion to Locomotion, add the variable isCrouching? From the pin drag it out and add a NOT bool and connect it all to the result.
Open up crouched locomotion now by double clicking now add our cached pose (Crouched) to the result
Compile and save.
Conclusion
You have now created a crouch input action and designed an animation blend space to facilitate crouching. This means you can now duck under low objects and hide behind cover like a true stealth master. Well done!
This versatile mechanic opens up a world of possibilities, from enhancing shooting accuracy to reducing detection rates. How you choose to implement and balance these pros and cons is up to you. Happy crouching!
Welcome, adventurers, to the first of many epic Unreal Engine 5 tutorials! When I first ventured into the vast realms of UE5, I was met with a labyrinth of confusion and intimidation. Though countless YouTube tutorials offered guidance, the seasoned explorers crafting them often moved at a pace that left novices like myself struggling to keep up.
But fear not, brave traveler! Enter my enchanted tutorial series, where written guidance shines like a beacon in the darkness. Here, you can progress at your own pace, and with the aid of detailed screenshots, each step of the journey becomes clearer and more manageable.
In this inaugural tutorial, we shall embark on a quest to master the basic yet essential art of character movement. Our first mission: to implement a walk mechanic. This spellbinding process can be woven into any UE5 template featuring a controllable character.
So, gather your courage and your creativity, and let us begin this wondrous journey together!
Why do we need to walk?
When we play a game we are not always running everywhere and we are also not walking everywhere. With the default presents in UE5 regardless if its FPS, 3rd person or top down. The max movement speed is the same. We can change this by creating a blueprint that is toggled by a key. When we do this the 2d blend space takes over and slows the animation or speeds it up depending on the way we go.
The Process
Start a new project or open an existing one that has a player actor blueprint for this tutorial we are going to use the thirdperson template. When you are in the engine we are going to setup a new action. Doing this will later on allow us to customize the key binding for our walk / run function allowing your player to customize what key binding they are going to use for it.
This has now been replaced by using the Input action and input mapping context system(look below for the updated procedure) To do this we are going to go to settings and search for action mapping. We will add a new action mapping using the plus button and call in Walk/Run Toggle and for now bind Caps lock to it.
Action map and blueprint
Since 5.3.1 released we do action mapping a little bit different, no long are we going into your project settings and mapping from there. Now we are adding an Input action and adding that to a IMC (you can have multiple of these)
Now we are going to create a new input. Navigate to Content>Thirdperson>input>Actions. Right click and go to input and select input action and name it IA_Walk/Run Toggle. Once created open it and leave all the options as default and click save and close it.
Now we need to add it to our input mapping context, should be in the previous folder. Its call IMC_Default, open this up so we can add our mapping.
Use the plus button and from the drop down select our IA we just created and bind it to the Capslock key as shown in the first screenshot and make sure you save.
Next we are going to find and access our character blueprint, depending on the preset you selected the name is going to be different for this example we are using the 3rd person preset so find BP_ThirdPersonCharacter and navigate to the event Graph tab. Click in a space to add a new node and search for our action event “Walk/Run Toggle” and add it.
Instead of inputaction it will now show as enhancedinputAction IA_Walk/run toggle
Just to reiterate, doing it this way allows your player base to customize what key they use when your game is released.
Next lets take a look at how we can create our blueprint to alternate our walk/run speed. We could do this with a flipflop however by learning the more complicated way of doing it will give us a few more options later on. So lets do this with a branch or a ELSE IF.
Firstly lets create a Boolean variable and call it “walking” compile your blueprint so we can set its default value and this is up to you however I am going to leave it unticked so our default state is running.
Once you have done this we need to now add this to our blueprint and start formulating our branch. Click and drag your variable into your blueprint and use Get. Drag off the pin and add a branch node. The Walking variable will now be the condition of the branch. Go ahead and connect our action node “pressed” pin to the branch.
Next we are going to setup our True/False conditionals, if walking is currently true that will change our movement speed down and if its false it will increase our movement speed. So lets add the Character Movement, from the top left in our components tab click and drag Character Movement to the blue print. From its pin drag out and add Set Max Walk Speed, this will allow us to alter the speed. Connect the true pin on the branch to the set and make the speed 500 (this is the default)
Now when walking is false we need to setup what to do. Once again drag off of the character movement node already in the blue print and add another set max walk speed. Position it so it is below the first this way it makes sense when we connect our false pin to it. For the value it is upto you but lets say we set it to 120. You should now see something that looks like this
now this is complete we still need to tell the walking variable what to do, so we need to drag and set our walking variable in and connect it to our top movement set and make sure its un-ticked. Do the same thing for the bottom set and make sure walking is ticked.
So compile and save so when you now play test and press caps lock or whatever is bound to it it should alternate the speed the character moves. Ultimately the speed set is up to you and what you want for your game.
Conclusion
So now, with just a press of a button, we can seamlessly toggle between walking and running, creating a more immersive experience for players. This enhancement allows them to better appreciate and explore the stunning landscapes you’ve meticulously crafted, making every moment in your game more dynamic and engaging.
Additional
We can expand upon this by controlling the speed with variables (Float) we would ideally do this if we want items, encumbrance or even a leveling system to dictate the speed at which our characters move. Just makes it a little more easier to manipulate. So Create two new variables and name them MaxWalkSpeed and MaxRunSpeed set them as a float, compile your blueprint and then edit the default value. Once done drag and get them into your blueprint and pin them into the corresponding set nodes we added previously.
Additional 2
Now we have a complete blueprint setup for Walk/Run toggle we can turn this into a function. This basically turns all of your nodes into one. This makes for a cleaner blueprint, this also makes it reference-able and reusable in any part of our game. To do this highlight all of our nodes and right click, in the contextual menu find and click collapse to function.
It will now appear on the left-hand side under the blueprints tab and we can rename it by right clicking and selecting rename. We can rename this function WalkRunToggle.
Additional 3
If you have a crouching mechanic you can also alter the speed of this using the same process simply add in your max crouching walk speed.