Switch Weapon Sytem

Hi guys

I need help for create an switch weapon system. I would like to exchange weapons with another of a button .
for example if I have a gun in my hands and i press “E” before a sniper , my gun fell to the ground and I get it in my hands sniper.

Plz help me , thanks

There are many ways to setup a weapon switching system but what would likely be the easiest to setup would be as follows:

  • Attach all your weapons to your mesh in your Character Blueprint
  • Hide all but the default weapon
  • Create an int variable called Current Weapon Index
  • On “Next Weapon” button pressed increment Current Weapon Index and mod (%) it to the total number of weapons
  • Plug Current Weapon Index into a Switch Node to change the visibility of all your weapons so that only the weapon you want to show is visible. If the Firing event is on the weapons themselves you might also need to toggle Enable Input as well.

I would suggest starting very simple and then slowly add in logic such as animating this process, adding and removing weapons, etcetera.

thanks for your réponse lanlabrie but my project is when i kill an anemy , he can drop random weapon and i would like trade my weapon with that weapon. Your idea is cool but can’t work whith my project :s

thanks for your réponse lanlabrie but my project is when i kill an anemy , he can drop random weapon and i would like trade my weapon with that weapon. Your idea is cool but can’t work whith my project :s