How to Add a New Custom Weapon Model

Introduction

This guide explains how to add a new weapon to an asset. The process involves replacing one of the current weapons and getting a custom weapon model working with everything in the asset.

Keep in mind that this process may not be perfect, and it depends a lot on how your custom weapon model looks. If it is significantly different from the base models, the animations may not work well and will require adjustment, either in Blender or in the game engine.

How to Add a New Weapon

  • The first thing that we’re going to need to do to add a new weapon is to make sure that we have a new weapon model! In our case, we’re going to be using this handgun from the Advance Weapon Pack on the Unreal Engine Marketplace.

  • Now that we have our weapon model, we’re going to go ahead and duplicate one of the weapons in the asset.

    • We can do this very easily by going to the Infima Games > LowPolyShooterPack > Useable > Weapons folder, clicking on BP_LPSP_WEP_Handgun_01, and pressing Ctrl + W. This will duplicate the weapon and should give us a BP_LPSP_WEP_Handgun_05.

  • We can now simply double-click on the newly created blueprint, BP_LPSP_WEP_Handgun_05, to open the blueprint.

  • Now, we can click on the blue text at the top, to open the full blueprint editor. The text says, “Open Full Blueprint Editor". This will open the blueprint.

  • By default, you will see the Event Graph. We can ignore this for now and click on the Viewport tab to see what we’re working with.

  • Now that the weapon is in view, we can add our custom weapon here. For this, we will need to click on the weapon, go to the top left Add Component, search for a Weapon Body, and click on it. This will add a new Weapon Body Component under the weapon component that is there by default.

I have renamed the component to Custom Weapon after creating it. However, this doesn’t affect anything.

  • We can now find the Skeletal Mesh property in this component’s Details Panel (the large panel on the right side of your screen) and change it to our custom weapon! In our case, this property’s value will now point to the SK_RogerLR220_Handgun_Yaxis mesh.

  • Seeing both weapons should now make it quite simple to align them. Specifically, as mentioned before, you need to align the custom weapon to the default weapon from the pack. Pay special attention to places that the animations change, like the grip and the slide on this handgun. These should be placed in a very similar position.

  • Now that we have the two weapons aligned, we can proceed to completely hide the default handgun model.

    • You can do this by going to Class Defaults, and under Infima Games > Low Poly Shooter Pack > Weapon Settings, you will find a variable called Weapon Preset Override.

    • Inside this variable, there is another variable called Row Handle Skin. We will be setting its value to Invisible. This makes it so that all of the default weapon’s mesh, and pieces, become completely invisible.

  • You should now see the new custom weapon by itself. The old weapon should be hidden by this point.

    • However, one thing that we do not have is the new weapon’s magazine. We can fix this very easily by going to the Content Browser, and heading towards the Infima Games > LowPolyShooterPack > Data > Weapons > Settings folder, and inside here, double-clicking on DT_LPSP_WEP_Settings_Magazines.

    • This will bring up a data table containing all the magazines in the asset, which we will be able to use to add our new magazine!

  • We can now simply Ctrl + W on the Handgun_01 entry to duplicate it and change the Mesh entry to our custom magazine on the new entry that was just created. In our case, the magazine mesh is called SM_RogerLR220__Mag.

    • Note: Make sure to be very careful not to modify the default magazines if you do not know what you’re doing, as this can break things.

  • Now, we can go back to our custom weapon blueprint that we were working in before, and once there, go to Class Defaults > Infima Games > Low Poly Shooter Pack > Weapon Settings and find the Row Handle Settings Magazine property.

    • This is the value that points to the magazine that this weapon will use, and should be set to Handgun_01 as of now. However, we want to make it point to the entry we just created (or well, duplicated). So, we will do so. In our case, by default, that entry’s name is Handgun-01_0.

  • Once you’ve done this, you will notice that your weapon is now using the new magazine!

  • If your magazine is rotated oddly, which in our case it is by default, you can click on it, and rotate it to face the proper way.

  • Our weapon is fully set up, so all we need to do is add it to a character. To do that, we must first include it in the DT_LPSP_Inventory Data Table. This can be done by going to the file located here: InfimaGames/LowPolyShooterPack/Data/DT_LPSP_Inventory, and opening it.

  • To add a new row to this data table, click the "Add" button located at the top of the table.

  • After creating a new row, we need to assign the weapon blueprint we've made to its "Item" property. In our case, we need to assign BP_LPSP_WEP_Handgun_05 to it. Once this is done, it should look like this:

  • In our case, we have also renamed the row to "Handgun_05" so that we are clearer on what this row represents when using it in the next steps.

  • To make this weapon the starting weapon for the selected character, we need to assign it as such. In this case, we will do that in BP_LPSP_PCH_Player, since it is the default character spawned.

  • Open it up and locate the "Inventory Component" in the "Components" panel. This component handles all inventory-related tasks.

  • To accomplish this task, locate the "Starting Items" variable in the "Details" panel of the component. Ensure that the first item on the array (0) has its "Inventory Slot Row Name" set to the newly created row, which in our case is "Handgun_05".

  • Make sure that “Randomize” is false! Otherwise, you will always get a random starting item.

  • Now we can try to play and see what happens:

  • It seems that we have encountered an issue: the field of view material is not being applied to the weapon. Fortunately, there are two ways to fix this quickly!

  • The easiest way is to disable the field of view material entirely in the asset. To do this, find the InfimaGames/AnimatedLowPolyWeapons/Materials/MPC_FOV file and set the "Alpha" value to zero.

  • Here's what that looks like:

  • Please keep in mind that using this method can cause models to stretch when changing the field of view.

  • Another way to fix this issue is to open the materials of the weapon model and add the following nodes to the "World Position Offset" output.

  • This will ensure that the field of view layer is properly applied, which will make the game look like this:

Setting up the New Iron Sights

  • This part of the guide explains how to properly set up the iron sights so that the aiming offsets can be modified.

  • You can also skip directly to the guide explaining how to

    modify those offsets by clicking here: How to Adjust a Weapon Iron Sights Aiming Offsets.

  • To add new iron sight settings that we can modify for our brand-new custom weapon, we first need to find the settings it is currently using and duplicate them. We can do this by opening the weapon blueprint we've created, in our case BP_LPSP_WEP_Handgun_05, and going to its Class Defaults.

  • Once we’ve done that, we will find the Row Handle Settings Ironsights variable, and click on the Magnifying Glass icon next to it. This will take us to the exact file it is using.

  • Now, we will open the file as shown in the video above and find the correct row for our weapon. The exact row will depend on the weapon we initially duplicated, as it will be named after it.

  • Now, we will duplicate this row and rename it to whatever our weapon is called. In this case, we will call it "Ruger.”

  • We will repeat this exact process for the "Row Handle Settings Scope" variable inside our newly-created row. Click on the magnifying glass, find the correct row, duplicate it, and rename it.

  • All that's left now is to assign all the variables to use our newly-created row. We can do this by going back to those variables we've followed and updating their 'Row Name'.

  • That's it! We now have an appropriate setup for our new weapon's iron sights. If you're interested, you can check out How to Adjust a Weapon Ironsights Aiming Offsets to learn how to alter the aiming offsets.


Last updated

Was this helpful?