Blueprint with multiple interactive objects

Hello!

I would like to be able to click on two different meshes which are part of the same blueprint and make each have two different interactions.

The reason they are connected is rotation, both meshes need to rotate 180 ° and stay in the same arrangement.

This should happen:

Click mesh 1 → rotation (I have a scene that rotates three meshes)

Click mesh 2 → material change

I tried with a branch but I don’t think it’s the correct setting: rotation happens, reverse doesn’t and neither does material change.

I hope there is a way because the only solution I have thought is to alternate the visibility of the second mesh and also of a copy of this in the position that would have had a 180 °. It would be more messed up like that…

Thank you in advance!

Thanks for the reply!

Maybe I misunderstood but I already have a line trace and I use the right mouse button:

Should I change it?

You need to use a Line Trace (or HitUnderMouseCursor if you’re clicking with the mouse), and in the hit result you’ll be able to get the hit component. From there you can do what you need based on which component you clicked.

I would like to be able to click on
two different meshes which are part of
the same blueprint and make each have
two different interactions.

Several ways to approach this. See if this is sufficient:

  • give each component a unique tag the actor can process

  • and send it via interface when interacting with a component:

It’s a somewhat crude example that can be improved, ofc.

Or even like so, more directly:


You could still use tags to filter interactions more granularly if needed. Perhaps this actor has elements that you’re not supposed to interact with, or interact in a specific manner.

To add a tag to a component:

I don’t understand the bit about adding component, you said you already have 2 components in the actor, no?


If you mean this…

…don’t worry about it, looks fine. It will be populated dynamically as soon as the Interface message is sent. We cannot fill it now because we don’t know what you’re going to click, not yet. It can be any component out of a million in the game.

This variable will hold a reference to the selected component.

I was referring to the fact that I had
promoted a variable Actor Component
type and called it “Interactive
Component” and I thought I needed to
assign a component to the variable.

No need to assign, as above - we don’t know at this point what is going to be clicked. To me it looks like you did it correctly. When you send the message, remember to specify the component:

Otherwise you’ll end up with the dreaded Accessed None errors.


Good luck with the rest!

Thanks for the explanation!

I have tried both methods and I had some problems.

If I use the first method, I cannot add the tag:

In the second case, I don’t understand how to connect the two actions and beyond that I have a problem adding the component:

What am I doing wrong?

I put the tags there, I thought should specify them here too:
352977-
][2]

However now it works thanks to tags. I don’t know why I kept having problems before, I only restarted UE…

Thanks so much for your help!

I was referring to the fact that I had promoted a variable Actor Component type and called it “Interactive Component” and I thought I needed to assign a component to the variable.

This is because I didn’t understand how to do this step:

Thank you!