Switching Main Weapon

Hello ,

I have a combat system setup in which the player starts with no weapon and when he picks an actor (BP_PickupActor) he gets to equipped to the child weapon class (weapon Wrench), the parent class for it is called BP_Base Weapon and then can enter the combat mode. Now I have one more blueprint of the same parent class that has different weapon class attached to it (Weapon Sword). My problem here is the character doesn’t store the weapon and when I pick up the other weapon it destroys the earlier one. I want to create a logic where I can toggle between the two weapons instead of every time picking it up.






Store them in an array and flip between the two, storing the reference to the active one, something close to:

The above could be written better, but that’s the gist. Would need to a tad different approach were there more than 2 actors to cycle.


[…]two object references

Probably more sensible approach if there’s only 2 actors to deal with, true:

Yeah, there will be as many ways to do it as there are blueprint wires.

2 Likes

i was going to say basically the same thing as above, but using a flip flop and two object references.

2 Likes

Let me try, I can for sure take away few things from what you have mentioned. I will share the progress to check if what I am doing is right or wrong. Thank you so much for lending me the helping handl.

Thank you so much, with a little tweaks it worked

1 Like

Thanks for the solution!