Open the character static mesh window - select the mixed space mode - select the bone tree option - find the hand_r bone node
Right click - add slot, rename it weapon
Preview: Right click on the weapon node - add preview assets - select the corresponding weapon
The approximate position of the weapon can be adjusted in the preview. (but not actually displayed, only preview)
Create a new Actor blueprint "weapon" - add corresponding weapon components to this blueprint
Open the character blueprint - right-click to create a new Spawn Actor "Generate Actor" - select the weapon blueprint weapon for class, and choose to ignore collision for collision. - Next assign the slot change value
The weapon socket belongs to the character mesh, so drag the mesh to create a new mesh key - drag the mesh key to create a new socket "get socket change" function - In Socket Name select the socket name, Transform Space selects RTS Actor - the function is connected to the SPawn Transform that generates the Actor
This only creates a weapon socket, but is not bound to the character.
Drag and drop to generate the Actor execution pin, create a new Attach and "attach the Actor to the component" - the mesh key is connected to the Parent, the Socket Name fills in the slot name, and the following three options "Align to the target"
Complete below. The trigger event is played at will.
After running, it is found that weapons can appear in the slot, but the character cannot move forward, which is caused by the collision of weapons.
Open Weapon Blueprint - Details > Collision > Collision Presets > No Collision
This completes the process.