Download

Multiple Guns, Pickups, backpack and slots

Yo gaming nerds how we doing?

been working with unreal for a little bit now still very new following all tutorials i can but im still struggling to find a good system for having lots of weapons?

I’m after system similar to say Dayz where you collect multiple items that can go into your backpack etc but the main issue is having lots of guns and have them equip and unequip and having slots on the character for actually housing the weapons. maybe M4 and Axe on your back slots then pistol in your bag or on your side then switching them out for other weapons when you interact with them in your world?

any tips advice or tutorials on this would be awesome :slight_smile:

thanks so much in advance

You are running around as a pawn or a character. on the static mesh of your pawn you can add sockets (which are just locations really). Each of your weapons should be an actor (pistol, rifle etc). You can attach any amount of actors (weapons) to your sockets (it is not one per socket). As you collect weapons attach them to a socket and also keep an array (in your pawn) listing all the weapons you have and the socket name they are attached to (so, you would create a structure with two entries - actorRef and SocketName and then make an array of that structure).
When you find a weapon in the world maybe press P to attach it to your hand socket, Press B to attach it to your backpack and set it to hidden. In both cases add it to the array.
You can use a widget to display all your weapons and add buttons to your widget to drop or swap a particular weapon.
Remember the 0.0.0 point of the mesh of the weapon actor will attach to your socket and you will need to set the weapon actor mesh up nicely so that they appear in your hand socket correctly.
Start simple and build up the complexity.
The array keeping track of your collection I think is key.

thats for the reply buddy means alot

im kinda ok with the socket and attaching its just a slick system idea im after for say for example i have a gun in my hand socket and two items in the back socket its the blueprint idea for getting this all to work… cant equip because slots are full?

ammo and food only to go into backpack (hidden) etc etc

ive been fully SG Unreal Creations 3rd person shooter tutorial which is awesome but its really build for like 2 guns i want to have like 12 different weapons all with different stats and be able to swap and change and pick them up etc etc

thanks alot

Yozza, keep the organisation nice and things will much easier. Stats for each weapon should be kept in the weapon actor. don’t be tempted to start keeping stats about individual weapons in your pawn. It may seem easy for one but becomes an unholy mess. You know when you are doing it right because adding a new weapon or adding a new feature to a weapon becomes sort of easy. If your code is becoming tangled and confused then start again and think about how things relate.
cheers
Podge.

Thanks buddy i’ll get my thinking cap on again… cheers thou dude

anyone else got any thoughts on this? thanks alot :slight_smile: