How do I use a Weapon functionality when picked up by the player?

I’m a novice… I want my player to be able to pickup a weapon. The weapon could be a melee or ranged weapon, whateva, but each has unique function… Anyways, the player is wielding the weapon. I want to place all the firing mechanism, ballistics etc, inside the weapon blueprint and not the character blueprint. How do I make my weapon blueprint catch the Shoot Input event? I’m sure this must be really simple but not sure which topic to look into.

I am currently working on an Inventory System with equip-able items. This is how I have approached the situation so far:

  1. I have a base item blueprint, and use polymorphism/Inheritance for all my items. So I have a base Weapon blueprint that inherits off of my base item blueprint
  2. All my base items/weapons ect all use my custom blueprint interface which has interface functions like: DropItem, EquipItem, UnEquip Item etc
  3. In all my base blueprints that inherit from my base item blueprint, I implement all the interface functions, making sure to add a call to parent
  4. I have all my functionality inside my base item, so when you pickup an item, it will call the implemented interface function

There are a few ways to go about equipping items, so I’ve found out in my post SetActorLocation weird issue when Simulate Physics Enabled - Blueprint Visual Scripting - Unreal Engine Forums I have a working version, that when you call AttachToComponent on the players skeletal mesh, it will attach the item to the socket described.

As for making your weapon blueprint catch the shoot event, the simplest way I would do this is in your player character blueprint, and the fire Input event and call a new interface function called fire, with all your logic inside the weapon class.


Implement interface in class settings in your Weapon item blueprint

In the player blueprint, listen for the Fire action key pressed, then call our interface function. You will have to pass in the weapon that is currently equipped. Note: You want to call the interface function that has (message) in the context menu

I keep all my logic inside my base item blueprint. If I want to do something special on a particular type of item, I would add it to say Base Weapons interface function, then call the parents function when I was done with my item specific logic.

Cheers Aaron.

I resolved this by simply enabling Auto Receive Input = Player 0