Add second weapon to player

hi I am currently using this example to take and leave the weapon, how can I add the possibility of getting to take up to two weapons at the same time and above all knowing how to switch them between them

I don’t know all of these type games, my referent is “Nuclear Throne”, left click = shoot, right click = to use ability. Some character can take 2 guns in same time, character look right you can see in hand (Gun1), character look left you can see in hand (Gun 2), these concret character if you click left (Gun 2 shoot), right click (Gun 1 Shoot).
Make these, put in variable [Grabbed] di weapons = 2 or specify class, for example gun Rifle in one hand and raygun in other!
variable [Grabbed] di weapon rifle type = 1
Position = Hand(Left) and boolean if you touch left
variable [grabbed di weapon ray type = 1
Position = Hand(Right) and boolean if you touch right

i’m still finding a solution to my problem … i’m experimenting to date i managed to grab the second weapon but i can’t correctly fix the release of the gun to the ground

What are your rules for picking up, using and dropping a gun?

For picking up, is it something like :

  • If the player is over the gun and FireB is clicked, pick up the weapon.
  • If player already has 2 guns and picks up a third, drop the first gun that was picked up.
  • Make the most recently picked up gun the one to use.

What are the rules for switching between the 2 guns?

And are there any other rules for dropping - like is it done with a key press?

I still have to define the rules for switching from one weapon to another. I am currently using this to release the weapon

once I have collected two weapons, I cannot understand how to switch the weapon and above all how to release the weapon used in place of the one found on the ground.

any help will be appreciated

Give the weapons a boolean object variable, say named “IsActive”, set to false as default.

When you pick up a weapon apply a “Toggle boolean value” to the object variable “IsActive” for all weapons linked to the player. The toggle command will change any true values to false, and vice versa.

If you want to switch weapons, also use the action “Toggle boolean variable”.

When you shoot, select all weapons linked to the player that have the “IsActive” set to true.

Thanks for your support