Free Falling / Diving - Unreal Engine 5 Tutorial
2 min read
1 year ago
Published on Apr 30, 2024
This response is partially generated with the help of AI. It may contain inaccuracies.
Table of Contents
How to Create a Diving System in Unreal Engine 5
Step 1: Download the Required Files
- Download the animations from the zip file provided by the tutorial.
- Locate the animations in the "U5 Mannequin" folder.
- Duplicate the fall loop animation into two additional animations: additive and pose versions.
Step 2: Set Up Animation Blend Spaces
- In the additive animation, set the minimum speed to -4000 and the maximum speed to 0.
- Divide the frames into four grid divisions.
- Add the poses from right to left: fall pose as one, transition a as two, transition b as three, and dive as dive blend space.
Step 3: Create Boolean and Float Variables
- Create a Boolean variable for diving and set it to True when pressed and False when released.
- Create two float variables for desired gravity and desired field of view (FOV) with values 1.75 and 90 respectively.
Step 4: Implement Gravity and Camera FOV Settings
- Get and set the gravity scale from the movement interface for a smooth transition.
- Plug in the gravity scale and desired gravity into current and target using World Delta Seconds for delta time.
- Set the speed for the FOV code, get and set the field of view from the camera using the desired FOV values.
Step 5: Update the Animation Blueprint
- Replace the character cast with the third-person character in the animation blueprint.
- Replace the character variable with the third-person character and connect the velocity by splitting the pin.
- Promote Z to a new variable "fall character" and get diving from it, then promote this to a new variable and connect it to the sequence.
- Open the main states in the anim graph, go to fall, get both blend spaces, plug in the fall speed, add a mesh base, drag out the fall additive animation, hook it up to the diving variable, and add a blend by Bool.
Step 6: Customize and Expand
- Feel free to customize and expand upon the foundation provided in the tutorial for your own projects.
- If you found this tutorial helpful, consider supporting the creator on Patreon.
By following these steps, you can create a diving system in Unreal Engine 5 as demonstrated in the "Free Falling / Diving - Unreal Engine 5 Tutorial" video by Haez.