How to interact with a component of a blueprint?

I have a blueprint of a boat that contains a control panel with several pushable buttons and I am trying to interact with the individual buttons via line tracing. Any idea how I can interact with the individual buttons and not the whole boat blueprint?

Create a Blueprint Interface class.
Rename default function to “Interact”.
Save and close.

Boat class, Class Settings → Add Interface

My Blueprint Tab, expand Interfaces, right click on Interface reference → Implement Event.

Add Print String (Interacted With).

Add a collision component to each of the buttons (sphere, or box), scale to fit.
Collision settings (Custom, Ignore all, block visibility)


Character class, Class Settings → Add Interface

Line trace → Break result → Other Actor → Does Implement Interface (your interface) → Branch [True]-> Other Actor → Interact Event.


This will get you interaction working. The trick/hard part will be determining which button was pushed. Both buttons are a part of the same actor.

You could add a component tag to the collisions (Button 1, Button 2). Then update the interface to have an input (primitive component), pass the hit results “Hit component” to the interface call.

Next, you’ll go to your boats Interact Event (one with the print string). Get component tags get a copy (0) → Switch on Name (Button 1, Button 2)

Create a custom event for each action… Button 1 event, Button 2 event. Add them to the switch pins.

2 Likes