How can i make two Blueprints communicate with eachother?

I think you shouldn’t use gates for this. I recommend to learn how to use interfaces. First make a blueprint interface, ‘Interactible’ for example, than has couple functions like ‘GetMaxRange’, ‘IsEnabled’, ‘Interact’, ‘GetHint’. Then write a function that:

  1. Traces in direction of Camera.

  2. Checks if traced actor implements interface ‘Interactible’

  3. Check if distance to object is less than MaxRange

  4. Call Interact on traced actor.

https://docs.unrealengine.com/en-us/Engine/Blueprints/UserGuide/Types/Interface/UsingInterfaces

I’m trying to get a door to only open when the player is close enough, looks at the door and presses ‘E’.
I figured everything out except for the ‘looking’ part. I’ve set up this LineTraceByChannel function and it works i guess. I’m shooting red strings everywhere I’m looking.

I’ve just not been able to make these two blueprints communicate with eachother. The first gate should only open when the player is looking at the door.
What do i have to use to make this work?

Add Trigger to your doors blueprint (I assume you’ve got one, you can make one blueprint and then make childs to make different doors).

Inside your character blueprint add on begin overlap then cast to your doors BP (Parent the first one not to child) and then you can access it for example open this door with some function.

For opening you can use animation or just timeline with add rotation and add it every frame…

Let me know in comment if you need more help with explanation.

I think i already got 1. Thats on the other picture. I put this tracing function in my character BP. I just dont know how to connect this to the door Blueprint.

I already have a working door. The problem is just that i can open it without even looking at it. I have to stand close to it, but i can open it with my back to it. I only want to be able to open it when i look at the door itself.
I’ve got this tracing thing implemented into my character BP, but i dont know how to connect that with the door BP. When i look at the door, it should notice that and let me open it.

Here is the demo on how to use interfaces. All stuff is in ThirdPersonCharacter.

BTW don’t forget to set this question as answered, if it solves your issue.

Break Out Hit struct pin on the Line Trace By Channel node - this will give you a plethora of data, including a reference of the object (Actor) the trace has hit. You will need to cast it to the correct type.

Your On Component Begin Overlap (Box) will never work as you’ve locked it behind a closed Gate that never opens.

Input is best handled in the Player Character or the Player Controller rather than in the target object.

The whole thing would look like this in the player character:

To be honest, the only thing I’d leave in the door actor would be the Timeline and Set Relative Rotation.

When it comes to text, you can keep it as is. But if you’re not planning on seeing several actors’ texts at the same time, why not keep a single Text Render Component in the Player, rather than burden every actor in the scene with their own. Scene actors can keep just a text a variable Player’s Text Render is updated with. This is optional, of course.

Ortroll mentioned Interfaces. They are a powerful communication method when you need to interact with multiple blueprint types; assuming here you’re making something more than a door simulator :). Worth looking into once you get the basic interaction I mentioned above going on.

I removed the text and also the collision box. The gate now opens when i look at the door and i can then open it. One problem i had was that the gate didnt close again after i looked away. I couldn’t think of a way to make it close again. I just made a delay close it after 0.2 seconds. Not sure how performance friendly that is ^^
I also used an interface. Didn’t know they existed. I’ve only started trying to do stuff with ue4 yesterday. I only know 0.2% of all the functions.

If you’re new to unreal I recommend to go through all those official tutorials. They are super helpfull.
Btw Interfaces is more of a coding thing. Simply doing ‘Cast To’ is enough for most cases.

https://docs.unrealengine.com/en-us/GettingStarted