Unable to Pass BP Interface Variable to Duplicated Actor

Was wondering if anyone has run into this issue before? I am sending an object reference from my third person character to another actor BP called “Portal”, which as a BP Interface enabled so that it can receive the passed object reference. Here is how I am passing the interface variable from my third person BP to the “portal” actor (I have confirmed that the receiving actor has the interface added)

Here is how the receiving “Portal” actor stores the object reference (within a variable called cam reference; I am also printing the display name and have confirmed that it is indeed storing the object reference correctly in game)

And this is how I am using the stored variable:

So basically, everything looks to be working fine: I send the object reference from my third person character at Begin Play to another actor BP called “Portal” which has the BP interface enabled; I am storing the passed reference into a variable once it is received, and I am printing the variable to confirm that it is indeed stored correctly. Now, once I place this “Portal” actor into the world, everything works fine.

The only problem is that once I duplicate the “Portal” actor, suddenly the duplicated copy cannot read the passed interface variable, saying that it is returning “none”. Strangely, only the original “Portal” actor stores the object reference variable correctly. Here is a screenshot of the exposed variables in-game:
ss4
ss5

As you can see, only one of the “Portal” actors is storing the variable, while the duplicated copy is not. So my question is how can this be; both are using exactly the same BP and are just copies of one another, so why is only one of the actors reading the received object reference?

You have managed to avoid actually using the interface :slight_smile:

Two main points here

  1. You make interface calls on a actor ( ACTOR :wink: ), you have already accessed the class type, which means there’s no point in using an interface.

  2. When you make the interface call, it should have a little envelope in the corner of the node. You don’t have that, because you’re doing a direct blueprint call, which you can only do because you know the type of the actor.

Your problem after that, is that ‘get actor of class’ of course, will not get both portals, only the first one you put in the level. So recommendations are

  1. Only use actor references. When you put two portals in the map, they both need a reference to the other. You can set this up with the eye dropper tool, in the level.

  2. Use the interface ( little envelope on the corner of the node ). Once you start using actor refs, you’ll see it’s impossible to call the internal event directly.

Thanks for the clarification! I completely missed the fact that the node is missing the little envelope symbol. As a side question; what is the purpose of the “direct BP call”/interface node with the yellow input?

If you see the yellow pin, it means you’re calling the interface on the same object you’re making the call from.

The only reason for that, is that it makes sense to use the function you have already written, because it’s actually in the same blueprint :slight_smile: