ON THIS PAGE
Customisation - Adding Weapons
Version 2.0
For Version 2.1, Click Here
Weapons can be easily added using Data Assets. Below is a guide to creating a new data asset. Customising Animations and Base Poses will come next.
Adding a New Weapon
Adding a weapon and animations from a marketplace weapon pack
In this video, I go over how to add a new weapon using a weapon pack from the Unreal Marketplace from start to finish.
Data Assets Explained
Adding a new weapon is very simple. Navigate to /Blueprints/DataAssets/Weapons/Guns. Weapons, along with other items, and contained within Data Assets. The blueprint class defines the variables and functions available to the weapon, and the red Data Assets are the “objects” you will reference for each weapon. These are similar to regular UObjects in many ways, but do not need to be created and references to them will persist between sessions, as all Data Assets are contained within the Data Registry in Project Settings.
Creating a New Weapon Data Asset
To create a new weapon, simply create a new Data Asset of the FPS_PDA_GunBase, under Miscellaneous > Data Asset. Alternatively, you can duplicate an existing data asset.
To create an SMG, for example, a good approach would be to duplicate the Rifle Data Asset, as only a few values would need to be changed.
After opening your new weapon, you will have a large list of variables that can be changed to your liking. The main ones to focus on are:
Gun
Gun Class
The Actor class the weapon will use when spawned. Most weapons can get away with using the base class, unless they require any function extensions or overrides (like the shotgun).
Animation Data > AttachSocket
The bone or socket the weapon will attach to. Ik_hand_gun is the default; however weapon meshes that are rotated incorrectly can instead use a socket on ik_hand_gun with a rotation applied to correct this.
Animation Data > RightHandPoseCorrectionTransform
A quick fix for weapon position on screen.
Animation Data > Animation Preset
A quick selection preset of character animations you can use if you have multiple weapons using the same animation sets.
Animation Data > Animation Overrides
Individual animations can be set here per weapon that will override the matching animation in the animation preset. Useful for things like unique reloads for special weapons, for example.
Animation Data > Weapon Animation Set
The animations that will play on the weapon mesh itself.
Attachments
Lists the default attachments for this weapon, and the bones/sockets they attach to. Also includes options to restrict certain attachment types and individual attachments from this weapon. Note that every weapon requires a default magazine attachment to provide the base magazine size and (optional) magazine mesh.
Reload and Ammo
Ammo Type
Choose an Ammo Category for this weapon. Determines what type of ammo can be used.
Reload Type
Decide the style of reload for this weapon. Weapons that reload 1 round at a time in a loop should choose Staged and have a suitable looping reload montage.
Current Ammo
For new weapons, this is the starting ammo in the magazine.
Ammo to Reload per Stage
The amount of ammo to reload for each reload loop in Staged reloads. Ignored for Standard reloads.
Firing and Projectiles
Projectile Class Type
Choose between hitscan or projectile shots.
Projectile Data Asset
Choose the projectile class. Hitscan shots share this class.
Available Fire Modes
Choose at least one Fire Mode this weapon can use. Choosing multiple allows the weapon to switch.
Weapon
Weapon Type
Choose the type of weapon from an Enum list. Mostly for categorization now.
Item Data
Display Name
The Name that shows in the UI.
Main Skeletal Mesh
The Mesh used by the weapon.
Setting Up Your Weapon Mesh
There are a few things you may have to do to get your weapon mesh working correctly. First, you will need to add sockets for a few purposes if your weapon skeleton does not already contain them.
Socket
sightsAttach
This is the point that Sights Attachments will attach to. This is needed for sights to not default to the root bone.
sightsCenter
This is the point that will align with the crosshair. All weapon and Sights meshes need this.
muzzle
This is the point at which projectile and hitscan shots are spawned, and where muzzle attachments are attached. Muzzle attachments also need a muzzle socket.
magazine
This is optional, and only needed if your mesh uses a separate magazine mesh. In most cases, a weapon that does this will have its own bone for this however, so you can instead change the Attach Point name for magazine attachments in your weapon's Data Asset rather than use this socket.
centerOfMass
This is used to center the Pivot Point used for the weapon in the Attachments menu, and to attach collision and other components to weapon pickups.
widget
This is optional, and only needed if your weapon is using a 3D widget display.
Testing your New Weapon
Once you have configured your weapon, you can select it in a weapon pickup to test it out
You can choose a Gun's Data Asset in a weapon pickup's settings in the world or on spawn