Interface message not calling Interface Event

Hello again, I am using an interface to send the “interact” interface function (message) from the player to the switch (switch has the Event Interact), the switch gets flipped (anim plays). This works just fine up until this point; after that then its supposed to send an interface message called “SwitchFlipped” to BP_SwitchDoor01 which has an interface event called SwitchFlipped at which point the door is supposed to open, but nothing happens at all. I breakpointed the doors SwitchFlipped interface event, and the sequence following that node and none of those get touched. Both blueprints have the interface in the class settings active. I am quite confused since its worked pretty much flawlessly up until now. I even made a variable object class reference that specifically references BP_SwitchDoor_01 for the target of the interface message from the switch to that door.

Any ideas? Below is the blueprint code for the switch and door respectively. Thanks again for any help! Its much appreciated! :slight_smile:

BP_Switch:

BP_SwitchDoor_01:

PlayerCharacterBP interact function (works well with all my other doors that just require the player to use them):

:confused:

Hi

Step through your function and check that the hard references are actually set! (with interfaces it will silently fail)
Do the referenced actors on which you are calling their respective interface calls actually implement the interfaces?
Do a sanity check and add in the does implement interface node with print string on fail during testing.

Hey, sorry for the long delay, I stepped through the switch function and it completely skips over the SwitchFlipped interact message which is supposed to trigger the Event SwitchFlipped in the doorBP. But I had a print string after the interface function and that prints out, so it reads it, doesn’t know what to do and goes on to the next node to be executed? I even changed the event in the door to be the regular interact interface event and message and that works when just interacting with the door itself.

Anyways, here is the output log after interacting with the switch, I am not really too good with deciphering this though,

LogBlueprintUserMessages: [BP_Switch_2] Sending SwitchFlipped Interact Message
LogBlueprintUserMessages: [BP_Switch_2] Sending SwitchFlipped Interact Message
LogBlueprintUserMessages: [BP_Switch_2] Sending SwitchFlipped Interact Message
LogBlueprintUserMessages: [BP_Switch_2] Sending SwitchFlipped Interact Message
FUdpSocketBuilder: Failed to subscribe UdpMessageMulticastSocket to multicast group 230.0.0.1 on interface 0.0.0.0
FUdpSocketBuilder: Failed to create and initialize socket UdpMessageMulticastSocket (last error: 0)
LogUdpMessaging: Warning: StartTransport failed to create multicast socket on 0.0.0.0:0, joined to 230.0.0.1:6666 with TTL 1
LogUdpMessaging: Warning: UDP messaging encountered an error. Auto repair routine started for reinitialization
FUdpSocketBuilder: Failed to subscribe UdpMessageMulticastSocket to multicast group 230.0.0.1 on interface 0.0.0.0
FUdpSocketBuilder: Failed to create and initialize socket UdpMessageMulticastSocket (last error: 0)
LogUdpMessaging: Warning: StartTransport failed to create multicast socket on 0.0.0.0:0, joined to 230.0.0.1:6666 with TTL 1
LogUdpMessaging: Warning: UDP messaging encountered an error. Auto repair routine started for reinitialization

Also switched up the references, did a cast to the blueprint, created a reference to the door in its own blueprint, called that from that blueprint and used the As BP_Switch_Door_01, and still the interface message (SwitchFlipped) isn’t ever read, this is quite weird. I also had, Set BP_SwitchDoor_01, and used the door object reference from the door BP and used the variable that was the same reference in the switch BP and got this in the output log, not quite sure how its accessing none, but when I did the cast to I never get that error message instead it just says SendingDoorInterface Message without any errors.

Before:

LogBlueprintUserMessages: [BP_Switch_2] Sending SwitchFlipped Interact Message
PIE: Error: Blueprint Runtime Error: “Accessed None trying to read property BP_Switch_Door_01”. Blueprint: BP_Switch Function: Execute Ubergraph BP Switch Graph: EventGraph Node: Switch Flipped

EDIT:

Also those 2 blueprints have the same interface in the class settings which is one that I also use to communicate damage between the player and enemies, I just made a new function in that interface called SwitchFlipped

New Switch Blueprint code:

EnemyDamageInterface/Interact/SwitchFlipped

No you shouldn’t need any casts, that defeats the purpose of an interface. The interface doesn’t know what it’s communicating with and shouldn’t need to know. It’s the job of the object to implement the interface and handle the outcome.

Yeah I was just doing that as kind of a failsafe test to see even if I did that if it would work, it didn’t lol. So I guess from what I can tell somewhere that reference is failing. Is it bad practice to create a reference to another blueprint in a different blueprint? For example in the SwitchBP I made an object reference to the SwitchDoor, and I also tried is valid and it said that the reference wasn’t valid. Now the part I am not sure about is how to make the reference to the SwitchDoor in the SwitchBP valid; sorry if all that was confusing also thank you for your help! :slight_smile:

Edit:

I just redid the object reference to the door that resides in the SwitchBP, and I breakpointed the interface message SwitchFlipped and it stops on that node but when I try to step into it doesn’t do anything? Just keeps repeating the send interface message SwitchFlipped and doesn’t go further than that.

Hard references will cause a lot of memory usage. You can try soft references with load async on the asset later on.

I noticed you are sending out interface message in your timeline update loop. You understand that this is constantly sending the message while the timeline is playing? (this should be done once either before the timeline or on completion, depending on when you need it)

Ah, I did not know that, thank you.

I saw it updating like that but I didn’t think it would have any effect on the door opening, so I just changed it on the timeline so when Finished, send message, it sends the message once now but it still doesn’t trigger the Event SwitchFlipped in the SwitchDoorBP. Its a step forward for me though! So now I just need to figure out why that event isn’t triggering even though the switchbp is reading the interface message

is switchdoor 01 valid? Perhaps its a null reference? Add an isValid node before it and print out a message if it is empty.

It prints out is not valid actually, any advice on making it isValid?

You can expose it (the open eye next to the variable) and add set instance editable and then once placed on the level you can set the door 01 reference from the details panel.

1 Like

Thank you so much! It works now haha, I was making my solution way too complex and also having the message run off the update on the timeline wasn’t helping debug at all. Again, thank you for all your help! :smiley:

Glad you got it working :). Happy coding and hope you can make progress on your project.

1 Like