rifle to pistol weapon swap

How would i go about add this weapon swap system where you switch from your rifle to your pistol and also have the proper animations and set weapon stats. I provided an image for an example.

you should ask one question at the time, like How to swap two weapon, how to set the animation, how to settle the stat etc.

This is also a good way to work since you should try to solve a problem at the time.

Anyway I am not a pro and I am not familiar with the animation system but I can tell you a first hint:

First you have to create inpût for you swapping weapon go Edit/ProjectSetting/Inpuit/ You add an action mapping
Remember the name you give to this key it is important

This button will be your switching weapon button.

Now on your character blueprint, if you only have two weapon it is simple, You create a boolean variable

Now press on an empty space and enter tjhe name of your command, it will create an event each time you press this key

Now after that create a branch

take your bool var(get variable) and link it to the branch

Now last step with the true not link set variable(to false)
and with the false not set variable(to true).

That the first step and many other challenge await you but like I saty try to do thing step by step and if you stumble accross one problem you can ask help here on a specific problem

Do you want someone to build a weapon swap system for you because that’s what it sounds like.

I suggest asking on this forum: https://forums.unrealengine.com/forumdisplay.php?76-Job-Offerings

I know its what its sound like but I am sure the guy is just new to it and is not sure what is the function of this forum. It is an honest mistake, a mistake I made myself in the past. Don’t be so harsh on him .

The way i do my weapon swapping system is i spawn both weapons and attach them both to the players arm i will set the secondary weapon hidden and the primary visible then when i use my input to change weapons i will set my primary hidden and secondary visible.

You will notice the animations do not fit the right weapon so when you change to primary/secondary you also want to change the animation class for your players arms.

****This part may be different in blueprint, this is a c++ abbreviation *****

then for the weapon damage etc i would setup a base class for all the things every weapon holds like the mesh etc, then i would make a child actor of that base class and set up the damage etc. I cant really tell you how to do this part but that is how 70% (ish) of it is done.


once all that is done you can then go on to adding delays and other thing…

I use c++ and not blueprint so it maybe slightly different from how you actually code it but that is basically how it is done.

In your image you also mention weapon fire rate (0.2) if you want to make your gun automatic this tutorial teaches you how. Very short and easy.