1. Create a new Blueprint Class and select SP8_InteractableActor as Class.
If you want to create your own Class, read here.
2. Go to Class Defaults and set Name and can be Interacted.
Create a Gameplay Tag and set the Interactable Actor Type to the new Gameplay Tag.
You should also add some logic to it. For example add a Data Table for a Shop or something like that.
Of course you can set it inside a Function as well!
You can add a Skeletal Mesh or Static Mesh or complete other things as well.
Just don’t remove Box and Widget_Name.
3. Go to your Player BP and call following Function on the SP8_InteractionComponent
Set the Interaction Type of the Function to the new Gameplay Tag (Created in 2).
Decide if you want that the Logic will take place on the Server (Example: Pick up) or on the Client (Shop, which only opens the Widget).
4. With PlayerTemplate:
Override SP8_Override_OnInteractWithCustomActor inside your Player BP.
Without PlayerTemplate:
Go to your SP8_InteractionComponent and add the Event: Interacted with Actor.
Inside this Function/Event you can put your logic.
You need to check if the Interaction Type is the one you have created.
The following Image contains the Logic of the SP8_PlayerTemplate as Example:
Explanation:
PickUp: Will be called on Server, so we can set that the Actor is not anymore Interactable and after try to pick it up (Add to Inventory). If failed we set it to be interactable again and if it worked we remove the Actor.
Enhancement NPC: Will be called on Client, because it only fires an Event which tells the HUD to open the Enhancement Window. If now the Player tries to enhance an Item, the Server needs to check if there is an Enhancement Actor in Range.