Table Of Contents:

Basic Animations and Mechanics

Before I started doing custom animations, I did try coding a basic player character with the help of this tutorial series by Ryan Laley (up until episode 6) using the default third person template and mannequin. I’m still not confident enough with coding to go from a blank slate, so even if I know much of what these tutorials show me, it always feels best to use a tutorial to start me off. It was a bit difficult to figure out exactly what tutorial to use to get me started, but it felt like stealth might be a good place as I plan on implementing that in the early areas.

However, as I got through this tutorial it felt like the third person template might end up being a bit or a restriction and the code given in the tutorial wasn’t put together the best. And ultimately, I couldn’t source the right animations for the mannequin that I needed and it was just delaying the inevitability of needing to reimplement custom animations at some point anyway. In retrospect, it feels like a bit of a waste of time since I didn’t use anything that I set up through this tutorial, but maybe it was a good warm up!

https://www.youtube.com/playlist?list=PL4G2bSPE_8un8IplTvVrqPRt7Ey8-3obR

Once I had made the first drafts of the animations I needed, I found a different tutorial by my old friend Evans Bohl who got me through the character and environment module in first year! The most crucial part of this tutorial for me was the animation blueprints as I’m not very familiar with it. The code so far is incredibly basic as I’m just using the character blueprint class’s built in functions.

https://www.youtube.com/watch?v=Ymsabf0ZQuE

image.png

On begin play I do the input mapping wizardry that I don’t understand as per usual, then set the max walk speed using my walk speed variable.

image.png

Move input with either WASD or left analogue stick. Getting the right and forward vectors from the control rotation means the movement direction is always relative to the camera direction. The control rotation Y is removed for the forward vector to avoid the movement speed slowing down at steep vertical camera angles.

image.png

The sprint simply sets the max walk speed to the sprint speed variable whenever the sprint button is held, and then set back to the walk speed when released.

image.png

A branch decides whether to crouch or uncrouch depending on the is crouching state used in the character blueprint class.

image.png

Stop jumping is to allow for height modulation depending on length of input, although it is fixed for the time being.

image.png

Camera input from mouse or right analogue stick. I made sure the input mapping context settings were configured as not inverted by default. Variables are available to invert the camera inputs which could be called on as a game setting. The camera is set up with a spring arm.

Animation Blueprints

image.png

image.png