How to change inventory slots in UE4 shooter game?

Hello all! I was wondering if I could change the type of weapon in each slot in the UE4 shooter game example. Thanks!

Hello Designer102,

You can find the code for the DefaultInventoryClasses being declared inside of ShooterCharacter.h. The values of this array are responsible for filling the player’s weapon slots when they are spawned, which you can see in the SpawnDefaultInventory function in ShooterCharacter.cpp.

As far as changing the values of this array, all you would need to do is open the PlayerPawn blueprint in the editor and change the classes in the array. The way the DefaultInventoryClasses array is declared allows for the values of this array to be set to the AShooterWeapon class or any classes that inherit from it. If you wanted to add more classes that could be set here, you would need to create blueprints based off the AShooterWeapon class. If you’re looking to do it all purely in C++, the information another user found at this other post may be helpful.

Please let me know if you have any questions.