UE5 Third Person Template
My Modifications to Third Person Template
Refactored pass 2 (4/5/24)
Background
-
First time using UE5
​
-
Wanted to learn more about how to create Character Controllers
​
-
Haven't done a 3rd Person shooter yet
​
-
Inspirations are Metal Gear Solid, Ghost Recon, Call of Duty
​
Locomotion
​​
​
-
Abilities:
-
Sprint
-
Makes player move faster​
-
-
Slide
-
After reaching a certain speed when sprinting the player can slide to go into a crouched position​
-
-
Roll​
-
Dive roll in the direction the player is facing​
-
-
Stances:
-
Crouch​​​
-
Prone
-
Player can crouch or prone​ to navigate obstacles
-
-
Main Difficulties:
-
Hard to change size of collider when crouching and going prone because Epic assumed that if you used the Character class you would only need a vertical collider. The only way to fix this is to rewrite the Character class or make your own Character class. Because of this I just decided to not fix it for now as that would be a project in itself.
​
-
The work around that I came up with was to change the size of the collider of the crouch mode whenever you crouch or prone.
-
The Roll was not something I wanted. I originally wanted to have a dolphin dive so the player can go into a prone position from a high speed like the slide. However, I am terrible at making animations and I couldn’t find any free animations that fit the purpose I was trying to achieve.
Animations
-
Recently Refactored
-
Added Animation Layers
-
Base
-
Overlay
-
-
Base: general movement like walking, crouching, and going prone
-
Overlay: top half of character used for different weapons​
-
Was important to do as this streamlines the animations. Instead of having different moving animations for each weapon the player is holding now there can be one base movement animation while having weapon animations be layered on top of that base. This makes adding new weapon animations trivial.​​​
Locomotion Animations with Weapons​
Sprint Animations with Weapons​
-
Each weapon has its own reload animation
-
The only exception to this is the shotgun​
-
​
-
Getting the shotgun to work was a challenge as it has a completely different reload than the rest of my weapons
​
-
Not only did I have to refactor my mag system for my weapons, but I had to find a way to make the animation dynamic.
​
-
The solution I came up with was to split up a shotgun reload animation into 3 parts.
-
1 to start the animation
-
2 to loop reloading a slug into shotgun
-
3 to end the animation
-
​
-
To my surprise it turned out pretty well​
Shotgun Reload Example
-
Main Difficulties:
-
The main difficulty of the animations was to make them look somewhat realistic. Since I didn’t want to pay for animations, I decided to use Mixamo with some animations from the UE marketplace. This was a bit of a pain as the Mixamo and UE animations didn’t blend well. They were also from different skeletons, so I had to retarget them to the proper skeleton
​
-
I also planned to do IK and even though I got it to somewhat work there were too many bugs with it, so I decided to scrap it. Hopefully I can get taught by a tech artist in the future who knows how to properly do all the IK stuff
​
-
Figuring out how to incorporate the shotgun was also a bit of a pain as I had to refactor my mag system which took a bit of time.
Guns
-
Recently Refactored
-
​Made Modular
-
Inherit from base weapon class
-
Can easily change values
-
Made weapons hold their own animations for player/weapon
-
Hold their own bullets/bullet shells
-
-
Guns are comprised of
-
Blueprint class
-
Gun component
-
​
-
Class: Holds the mesh
-
Gun component: Takes care of all variables related to the gun like
-
rate of fire
-
recoil
-
bullet spread
-
fire mode
-
animations for reload
-
bullet spawn position
-
current magazine
-
Mag System
-
Recently Refactored
-
Had to accommodate for weapons like shotguns where they don’t always use mags
-
-
Each weapon type gets its mags from the player
-
Each weapon can cycle through the mags that the player is holding
Mag System Example
-
Main Difficulties:
-
This system was a lot harder than I thought it was going to be as there are many edge cases that I need to account for like picking up ammo.
-
Normally games with this type of system have ammo tied to the weapon. This makes things a lot simpler, however it’s less realistic and can sometimes be frustrating when picking up the same weapon you currently have off the ground and realizing that it has no ammo.
-
The other option that games do with this type of system is disabling the ability for players to pick up weapons off the ground. Whatever weapons they came with they are stuck with. This is fine but also unrealistic and frustrating when you run out of ammo.
-
Though I don’t think I fixed all the edge cases I do believe the system I have set up is proof of concept that it is possible to create a polished version of this system. One that is realistic and less frustrating.
Fire Mode
-
Recently Added
-
Guns now have the ability to have Fire modes
-
Current Fire Modes:
-
Single
-
Burst
-
Full Auto
-
-
Can change rate of fire for each of the modes
-
Can toggle off if you don’t want a weapon to switch to a different Fire mode
Fire Mode Example
Bullet Spread
-
Recently Refactored
-
Bullet spread applies to
-
Standing/Walking
-
Crouching/Crouch walking
-
Prone
-
Tactical Aiming
-
Bullet Spread Example
Recoil
-
Recently Refactored
-
Based off a curve
-
In Gun component you can
-
Toggle recoil
-
Create your own recoil curve
-
​
-
Probably not the best way of doing it but it works and is customizable.
-
Examples of weapons that have recoil
-
Pistol, SMG, Shotgun, Rocket Launcher
-
Weapon Inventory
-
Wanted the player to be able to pickup weapons off the ground
-
Needed a inventory to be able to cycle through weapons
-
Added unarmed state to player​
-
Made 3 slots for inventory
-
Primary: go to side or back
-
Secondary: go to holster only
-
Heavy: go to back only
-
-
Can switch between all 3 slots​​
-
Examples of weapon slot types
-
Primary
-
Assault rifle, shotgun​
-
-
Secondary​
-
Pistol, SMG​
-
-
Heavy​
-
Rocket Launcher​
-
Weapon Inventory Example
-
Main Difficulties:
-
The hardest part of this was fixing bugs related to swapping/picking up weapons. I spent awhile trying to fix as many edge cases as I could find. I’m sure there are still more but it is in a working condition where I’m not going to worry about it now.
Bullets
-
Recently Refactored
-
Made Modular​
-
Inherit from base bullet class
-
Hold their own effects​
-
Can easily change mesh​​​​​
-
​​
-
Can easily make guns like this now
Chicken Launcher
Video Progress over the School Year
First pass on prototype (10/31/23)
2nd pass on prototype (12/3/23)
Refactored pass 1 (2/27/24)
Refactored pass 2 (4/5/24)