Item Blueprint Setup
Everything in these assets have been kept as light as possible to make it easier for you to modify them.
Last updated
Everything in these assets have been kept as light as possible to make it easier for you to modify them.
Last updated
In this section I'll be going over the act of setting up the item blueprint's. For now I will only provide a guide to setting up gun item types. Logic related to Picking up and Holstering Items have been mostly kept in Actor Components so as to make it simpler to strip these things and allot you to explore their logic without feeling overwhelmed. This system is built on tried and tested Object-Oriented Programming approaches where inheritance is used to reduce copied code that should be shared. In the DAO/Blueprints/HeldObjects folder you will see the BP_HeldObjects_Master Slot Actors (used for gun holsters primarily which are attached to sockets on your character), Items, and Guns all inherit from the HeldObjects Master. This asset is responsible for physics and Mesh setup. This is also where it checks the Item Data Object reference to see if it is a Static Mesh or a Skeletal mesh, it will then create the appropriate Component for that Asset. After it has setup the Mesh, it will automatically assume you don't want collision with Characters. If you wish this to be handled differently then this would be the place to start. Each Item will need a Chooser, this Chooser will Store the Character Specific Data for this Item. The first time this information is requested from the Item it will run a chooser, it will cache this value, and it will only run the chooser again if the character holding the item changes. This Character Data will Require a Gameplay Tag which we will use for identifying the Body of this Character. For MetaHumans there are 18, 9 Male, and 9 Female Body Types. I would suggest you keep the variety of Body Types in your game to a minimal to reduce the amount of work required for setting up all the items and weapons in your game. The Following is the process for setting up a Gameplay Tag for your Character, this Gameplay Tag will be stored on the Char Tag variable under your Character's Class Defaults and will be referenced by your Item when looking up that character's Data. Go to Edit->Project Settings Go To GameplayTags and Manage Gameplay Tags Somewhere in here create a GameplayTag for Identifying this Character's Body Type.