In UE5, how can two unrelated blueprints communicate? For instance, I have a BP_Key, a BP_Door, and a BP_Lock. I unlock the lock with the key, and the lock needs to notify the door to open. How can this be achieved?
You create an Interface for BP_Key with an Unlock function.
BP_Key calls the interface function in the object it hits (for example).
BP_Lock - implements the Key Interface. You define what should happen when BP_Key calls the Unlock function.
BP_Lock also has a Dispatcher. When it Unlocks, it also calls its Dispatcher.
BP_Door is bound to the BP_Lock Dispatcher. You must Bind the Unlock Door function to the Dispatcher, and it will be called when BP_Lock tells it to.
Thank you!
Thank you for your answer. I tried using this dispatcher before, but it seemed a bit troublesome to use. Because I only found this method: The interface I use named BPI_Unlock, so in BP_Lock I do this: get game instance - does object implement interface - Cast to BPI_Unlock - Cast to BP_Door.