How can I pass data / trigger event between blueprints without hard reference?
For example I want to trigger a blueprint B event in blueprint A, there are some ways I can do:
1.Cast blueprint B in blueprint A which cause hard reference.
2. Use interface, but I need to provide target when I call the interface in blueprint A (get actor of class, cast) which cause hard reference.
3. Use event dispatchers, then I need to cast blueprint A in blueprint B to bind the event which cause hard reference
Is there a way to avoid hard reference? Use level blueprint or game instance perhaps?
Interface is the way. You don’t use get actor of class, you just use an actor reference, that’s the key.
The rest really depends on what’s talking to what…
What are you trying to do?
1 Like
Here’s a BPA ready to send a message
Notice that the reference is of type ACTOR, not BPB, so hard reference doesn’t matter, because it’s an engine generic type.
If I put them both in the map, I can setup the reference like this
But how you set this up really depends on what two things you’re trying to connect together, and whether they are spawned and yada yada yada…