Button Interaction with a Actor, Actor is stored as a Variable

Hello everyone,
I have a short question for you, but a problem for a newbie like me.

A button should give an Actor (in this example Door1) the signal to open when it is pressed.

The Actor is stored at the Variable “ActorSelect” with Variable Type Actor (see 1).
(Its chosen at the Worldmap Masterbutton under default).

So my goal is to choose an actor via Variable to interact with and send it a Signal to do whatever it should do (opening, moving, etc.)

Ive already programmed a working method, where i go through all classes of type Door and select the one with a specific Indexnumber.
But i just want a solution, where i can choose the Actor directly (with a Variable like ActorSelect) and start the Actors event.

I thank you very much in advance!

Hi,

If you make the “actor select” not be type of actor but instead be of type door you will be able call events from the door actor

1 Like

Thank you for the Answer DLPS.

But then i restrict myself to only taking the object door and for my Variable “ActorSelect” i only could choose Door1 Door2 etc.
If I chose other actors who aren’t Doors, it wouldn’t happen.

So the Door is just an example.

The Goal is to select the Actor with “ActorSelect” and then in the Blueprint it should send a Signal to the specific Actor.

The concept you’re missing, is blueprint interfaces. Then you can talk to any type of actor :slight_smile:

To be clear, you could make a blueprint called ‘interactive object’, and then make everything in your game inherit from that. Then they would all have the same parent type, and that would be your variable type. But it’s much easier to use BPI, because you can do so immediately without having to modify your inheritance structure.

1 Like

Thanks for the Reply.

No, i already use a Interface, wich allows me to click on any Actors from my ThirdPersonCharcter.

So my Pawn can click any Button (and anything else to act with), but a particular button should interact with a particular Actor, which can be changed via Button Variable “Actor Select”.

But the second Method which you mentioned could be a alternative solution.
And I’m wondering if there’s an easier way.

This is what blueprint interfaces are for… exactly what they’re for… :slight_smile:

2 Likes

ClockworkOcean thanks for your Reply.

Yes…it is truly what they are for :D.
Sometimes the solution lies in front of the nose…

I have already implemented it and it works perfectly.

Now i chose my Actor at “VariableSelect” as mentioned before and with the new Interface i get a signal to that particular Actor which i want.

Its the Solution of my Problem.

I’ve marked your first Reply as the Solution. Thank you very much!

1 Like