Hi everyone, I’m seriously going crazy trying to figure this out, if you help me I will appreciate you for the rest of my life.
Short version: My UI Widget Blueprint does not hear messages from an interface, while my Pawn blueprint does everything the same and can hear messages from the same interface no problem.
Long version:
I simplified this as much as possible.
I have an actor called BP_Actor.
I have a pawn called BP_PlayerCamera.
I have a User Widget called BP_HUD.
I have a HUD blueprint called BP_HUD2.
I also have an Interface called BPI_Activate.
These Blueprints are set up properly in my world settings:
BP_HUD2 gets loaded and draws the BP_HUD on the screen, no problem:
This draws the HUD and everything works fine.
BPI_Activate has a function called “In_TestFunction”:
BP_Actor has a cube, and when this cube gets clicked, it sends a message to “In_TestFunction” through BPI_Activate (which it has added as an interface in its Class Settings):
I added a node pair for both HUD, and Camera, just to be sure both will receive this:
In BP_Actor’s variables:
The “TargetCamera” variable references BP_PlayerCamera
The “TargetHUD” variable references BP_HUD
The Class Settings in BP_Actor has BPI_Activate added as an interface:
Now, when I go into BP_PlayerCamera, I have everything I need for this pawn to receive messages from BPI_Activate.
I have the BPI_Activate added as an interface in Class Settings:
I have a variable referencing BP_Actor:
And I’m able to add an event based on messages received from BPI_Activate:
This works, and it prints the message.
HOWEVER, the problem is in BP_HUD.
I’ve done the same things in BP_HUD as I did in BP_PlayerCamera to be able to hear messages:
1: I’ve added BPI_Activate interface in Class Settings:
-
I have a variable in BP_HUD that references BP_Actor:
-
I add an event based on messages received from BPI_Activate:
But THIS, does NOT work. It does not print the message on screen.
Even though in BP_Actor, you can see the message is sent first to BP_HUD, and only afterwards
to BP_PlayerCamera. But the former doesn’t get the message, while the latter does:
This is driving me crazy. Why can a Pawn blueprint hear the interface but a User Widget blueprint cannot?
At this point I’m NOT trying to solve the problem, I’m trying to understand how and why Unreal Engine does things a certain way. So please don’t suggest alternative ways of solving my problem, I’m just looking to understand why this particular setup doesn’t work.