Hi All, I am new to unreal and I have been struggling with creating an interaction system on a set of drawers (BP with multiple SMs).
I have created a Actor Component that deals with the line tracing and setting a trace Area for the outline. This is attached to the Main Character and when the character interacts with a set of drawers it outlines the individual drawers and I have the widget shown in the centre of the SM like so:
One of the main ways to gain efficiency is by using blueprint inheritance.
Once you’ve written a parent blueprint with you can interact with, you can generalize it by just adding more meshes ( mesh components ) to a descendant.
So, this chest would be a desendant of the parent BP, you would have marked the draws as interactive ( how you do that really depends on how the parent is written ), and the movement code for the drawers is the only ‘local’ thing here.
Everything happens in the parent BP, including the highlighting. The only thing in the player, is the line trace.
Thank you @ClockworkOcean. I understand inheritance (I have come from a Java Developer Background) but new to unreal, so I will take a look at this video.
If I am understanding what you are saying, is to create a BP_Master (not a great name), which contains the logic to show the widget, the outline and the duration of the interaction for example. You would then create a BP_Drawer which is a child of the BP_Master which contains the SM_Drawer and the 6 SM_Draws?
If so, the only part I am not getting is how would you target the individual SMs as you focus on them via the Trace by Channel which is within the Actor Component?
I have added my Trace Function from within the AC. Is this not a good place to put it, but within the Master Blueprint instead?