Emabrrasing: My Blueprints can not access player's widget?

Trying to implement a sort of LOG messages system.

So I have a MAINWidget, with a big scroll box ready to be populated with OneLIne_Widgets.
Like this:

The OneLineWidget has a exposed variable connected to the textblock:

The main MAINWidget graph has a CustomEvent named “Add LOG line”

At Begin Play, my Player Controller creates the MAINWidget, stores as variable, and adds to viewport.

That’s the setup.

Now I want other blueprints to be able to add new lines to the log window. Like this:


Get a reference to the Widget, then call the CustomEvent feeding it with expected string.

But, as you would expect, I get this error

I’ve tried lots of different variations of this, with and without assigning “self” as widget ownwer, with the MainWidget created by the LevelBP instead of the PlayerController, also tried interfaces, functions…

I thought I had understood BP communications but it seems a actually did not. What I’m missing?

Any clue?

hey,
i don’t see any Set MainWidget in your exemple code, so you are probably missing that :slight_smile:

3 Likes

I didn’t include screenshot of the PlayecController setup, but it’s done.

It’s like this

I’ve edited the initial post to include this capture.

I’m shocked I can get stucked with things like this one year and 3 projects after migrating to Unreal.

thanks, @Firefly74

do you have a sub class of FQ_PlayecController ? of it’s the final / spawned one ?
if it’s not the final one ( and it has a child bp), right clic on the event begin play in the child and add a call parent function node, and link it to the begin play )

could you try to add a 5 second delay between the random bp begin play and the cast /get player controller ?

for further debuging, add some print node ( or breakpoints ) to have a better insight of what get called ( or not ) and in what order

2 Likes

It was the delay!

So instead of creating the Widget on BeginPlay, I’ll wait for an event dispatcher that activates when everything is ready, and that’s all.

I also need to re-read some basics…

Thanks again @Firefly74