Hello Everyone !! I’m new to Unreal Engine, and I try to create an Action system !
I want my player to interact with objects in the scene. First I created a BP Interface with a function that returns an array of “Actions”. At the beginning, an action was just a structure with a name, a description and an icon. But when I needed to execute my action, I was lost.
So I deleted my structure and did the same with a Data Asset ! I created a Blueprint that inherit PrimaryDataAsset, created my variables and added an Event dispatcher called “Executed”. I have also a function that just call that event. Then I create one DataAsset by Action (Pick item, Open Door etc…) But it not contain the action itself. For example I have a generic Actor that inherit the Interactive BP interface, and I manually return an array of actions with my “Pick Item DataAsset”. Then I listen the executed event on that Actor, to do the pick logic.
It’s my Character class that listen inputActions that get the Action (DataAsset) with sphere tracing…
My problem is that when I listen the event of the Data Asset from my Actor Blueprint, I can’t use “GetPlayerCharacter” or “GetPlayerController”, or I can’t “Destroy” on self reference to destroy the item when picked… I’m a bit lost, is it the best way to do that ?
I tried to make a schema :
Thx everyone !