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

  1. Download the animations from the zip file provided by the tutorial.
  2. Locate the animations in the "U5 Mannequin" folder.
  3. Duplicate the fall loop animation into two additional animations: additive and pose versions.

Step 2: Set Up Animation Blend Spaces

  1. In the additive animation, set the minimum speed to -4000 and the maximum speed to 0.
  2. Divide the frames into four grid divisions.
  3. 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

  1. Create a Boolean variable for diving and set it to True when pressed and False when released.
  2. 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

  1. Get and set the gravity scale from the movement interface for a smooth transition.
  2. Plug in the gravity scale and desired gravity into current and target using World Delta Seconds for delta time.
  3. 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

  1. Replace the character cast with the third-person character in the animation blueprint.
  2. Replace the character variable with the third-person character and connect the velocity by splitting the pin.
  3. 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.
  4. 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

  1. Feel free to customize and expand upon the foundation provided in the tutorial for your own projects.
  2. 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.