Switching Class Spawns

I have a Character Blueprint that spawns an object (WeaponCube) at mouse location when the game begins. The Weapn Spawn calls for the Weapon Blueprint. I am trying to make is so that when I press a key on the number pad, a different object spawns at the location of the mmouse, replacing my Weapon Cube. So by default, The Weapon Cube spawns, it should also be enabled when ‘1’ is pressed. When ‘2’ is pressed, a sphere object would appear, and so on up to number 5. How do I approach this?

Here are my Blueprints : WeaponCubeBP, and my CharacterBP

Make a Array of Classes and fill it with defaults. If you hit 1 get index 0, if you hit 2 get index 1, and so on… than you Destroy the Weapon you already Spawned and Spawn a new one from the Class you pulled from the Array and assign it to the Weapon Variable.

If you want you can create a Spawn Function and pass the Class as input so you dont have to duplicate Code.

Thats it good Luck =)

Also I would move your Code you have in the Cube BP into your Character BP. Use the Weapon ref to move around, and use a isValid Node since you deleting Weapons it can be empty in some cases that would result in a Crash or Access None Error.

Thank you! I’ll give this a shot.