How do you make a gun that can shoot different types of projectiles and with different functions

This my second question for the day but I should luck with my previous post. I thought I take another swing today. Any advice on how to make a gun that shoots different projectiles that the player would be able to flip through. So to give an example of what I am talking about is in the Xbox 360 GhostBusters the VideoGame you’re proton pack has different projectiles that it can shoot ( I know that most of the projectiles are some sort of beam ) but there was the shotgun burst for the statis beam and the rapid fire meson collider. And you could switch between these projectiles or modes or whatever you want to call it . the thing is I want the player to be able to select more or less in the same manner. I know there are some tutorials that does this but they use the first person shooter template and I was wondering if there’s a way for a third person shooter? I was thinking of multiple scene components for the different projectiles but maybe someone smarter could help me? XD

It could be as simple as:

  • projectile classes sit in an array
  • the player changes the index
  • when firing, pull a projectile class using the selected index

And it would work OK. You can always refactor later if more nuanced logic is needed.

Thanks! You’re two for two! I’ll try these out when I get off work today. If I ain’t too tired. XD