Weapon cycling suggestions?

I’m working on a simple 2d side scrolling shooter game with an assortment of weapons. Instead of just changing the bullet style for the different guns, there is a actual object for each weapon (Similar to Einhander, an old PS1 shooter).

Right now the weapons are assigned to number keys and become available once you grab their weapon icon. I’m using the visibility actuator combined with a loading animation for the swapping.

I’d really like there to be a single button to cycle through the weapons, but I’m not quite sure how to do it. If anyone has any suggestions or knows of any examples, I’d appreciate the help.


have the button add to a property and display the gun according to that property

for example you press UoArrow and it adds to the property (CurGun) and when CurGun is 1 it displays a machine gun and when its 2 it shows a pistol 3 a shotgun and so on and when it gets to the max numbver o weapons the property sets itself to 0 again

Thanks. That did the trick. Now that the weapons cycle, any thoughts on a good way to only cycle through the active weapons? I’ll have to experiment with that a bit.


You could have a Bool property so when it’s set to True you can activate it, and have it false when it’s not activated.