top of page
Search
Writer's pictureKelson Wysocki

What I've been doing in Unreal Engine 5

Hello everyone. It has been a while since the last time I wrote a post and there are many projects I've been working on since then. Here, I'll do a quick rundown of what I've been doing in Unreal Engine 5 (UE5), and in the future, I will also talk about projects I've done in C++ and Godot.


Unreal Engine 5 has been a major focus of my projects for over a year now and frequently these projects have explored the features of UE5 and focused on creating game mechanics using Blueprints and C++. One of my projects, called Symmetrical Parakeet thanks to Github's name generator, is a third-person project where I implemented gliding and flying mechanics to traverse the world which required me to work deeply with UE5's physics and character movement components.


During this project, I kept running into limitations in the default character movement component, causing me to find ways to get around these issues. Sometimes this would mean making a system from scratch and other times I would dig through the UE5 source code testing different pieces to find a feature that did what I needed. Through this process, I learned about many UE5 features I didn't know about and how to build complex movement systems from the ground up.


The gliding system was the main part that needed to be built mostly from scratch. As a base, I used UE5's physics simulation on the player while gliding is active to give them reasonably accurate movement while falling. On top of the physics simulation, I would perform line traces to check for incoming walls or ground to determine how to handle collisions or blend animations for landings. If there were no walls or floors nearby the new velocity would be calculated using inputs from the player and the current rotation of the character which was then manually applied to the character.


Along with the velocity and rotation of the character, there were two player states while the character was in the air one being the actual gliding and the other being falling. These two states were similar but gliding would have more lift and forward velocity and falling wouldn't allow the player to change their trajectory. Because of these similarities, I included them in the same class with a boolean to determine if the player was gliding or falling.


After getting a basic glide working I decided I wanted to try a flight mechanic, allowing the player to move in any direction they were looking. To start on this, I first separated the "fall" behavior from the "glide" by putting it in a separate class and attaching it to the player. This meant I would continue to have the falling state I had created without needing the entire glide class attached to the player.


My original idea for the flight mechanic was to use a spline to control the player's direction and motion. For this setup I created a three-point spline, the start point being the player, the endpoint being the ideal ending location, and a middle point between the two others. The endpoint would be influenced by the user inputs, moving left, right, up, or down depending on the pressed keys. Once the spline was created the player character could be interpolated along the spline to produce the motion. After implementing a basic version, I found that the spline method felt too stiff for a flight system and there were issues with updating the spline so often during runtime, leading me to find another approach.


The next method I decided to try was manually controlling the velocity of the character movement component. For this approach, I would calculate the desired velocity using direction input and how long the flight action input had been pressed. Next, the new velocity would be an interpolation from the desired and old velocity to create a smooth transition. Once the velocity was found I would determine what direction the player model should face and update its rotation to reflect the new velocity. If the player turns rapidly a roll rotation would also be applied to the character.


Another major part of working on these movement systems was learning more about using animation blueprints to have animations respond to the environment and player actions. These can be seen in the diving animation when jumping on the edge of a cliff and the blend when activating the flight mechanic.


During this project, I learned a lot about using C++, animation blueprints, UE5 physics components, and what it takes to make movement mechanics that feel smooth and interesting to use. I look forward to taking everything I learned on this project and applying it to future projects both in and out of UE5.


Coming up soon I will be posting more about other projects I've worked on recently.

11 views0 comments

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page