Custom Event doesn't react

I’m trying to make a CCrosshair “selection” and when I press one of my button for selection :

A Custom Event Should Be called…


But It does not work. When I clicked on the button it does not print the second string :


If you can help me it would be really great …
Thank you !

How did you reference PlayerUI. Are you seeing anything in the log? Access None errors?

I just created a variable refence to Player UI. Is it why it doesn’t work ?
What do you think I should do ?
Thank’s a lot !

Great News - Your custom event is working fine

See the picture:

Green = Good / Red = Bad / Yellow = Your Problem

I realized this when you said " it does not print the SECOND string…" - Best of Luck

Sorry. When I was saying second print. It was before I remove the print
So what there is 3 prints
There was the first : Saying if i called the event
The second : Saying if the event has received the call
And the third : Saying the new value for the crosshair

But thank you i’ll correct that !

happy to help

Thank’s to you guys. I solved the first problem. But here is the thing.
Now I can’t even Modify my in-game crosshair
The modifying of the value of “Crosshair” works.
But the Get_Text to update the crosshair does not work anymore :
Here is it.

I don’t know why and I think you can’t help me with this. So if you need something, tell me.

The crash probabl come from one of the blueprints cuz’ there are two options :
Or the UI doesn’t appear
Or it appear but not with the good Crosshair …

At what point is this function run? If it comes before the Set Crosshair node then it won’t have anything in it unless you have a default value.

What did you mean about the function Run ?
Can you explain. I’m new, it’s my first project. (From Blank)

I think I understand what’s happening here, but it’s going to require some elaboration on my part - so stick with me on this

What Sithunter is asking is this…

We can see that you have created a function called “Get Text_0”. He’s asking WHEN is that function being called?

Because - if it’s called BEFORE Set “crosshair” occurs (which happens when you call the Custom Events in your picture that I sent back to you yesterday), then it won’t have the information from that corresponding setter.

Now - all that being said (and correct me if I’m wrong) from my experience I believe that specific function “Get Text_0” was created from a “Binding” in the widget BP your working in

If I’m correct with that, then you have to understand that binding function - is running constantly. It’s not like a regular function that you would call manually. And to Sithunter’s point, its running BEFORE your custom events are called to Set “Crosshair”

So before going any further, I want to just confirm that you understand everything I’m saying here so far? If so, then I will continue with potential solutions for your problem

I knew about the binding text function who run constantly.
But the problem is “why it doesn’t run ?”
So I don’t know why I should call this function ? If it run constantly

I’m now okay with what your saying.
Thank you solving my problems.
You can continue

I tried some things.

When I don’t put anything on the textbox :
Nothing changes.

When I try to put a value to my “Crosshair” variable (text) :
The new value is on the screen.

  • Now we now that we have a problem with the “Crosshair” var.
  • The Player UI is well-displayed.

I don’t know at all what’s going on with my blueprints …

ok lets back trace just a moment here

you asked: “why it doesn’t run ?” - I’m saying it does run, its just that the variable in it “crosshair” has no value initially

you asked: “So I don’t know why I should call this function? If it run constantly” - I’m saying you don’t have to call this function at all, we’re in agreement it’s being called constantly

In regard to the “Crosshair” variable: On Event Begin Play / Event Construct (for the widget) - “GetText_0” is running

But the value of “Crosshair” isn’t set at that time - why - because it’s not set until you call the custom events that set them (as per your picture)

Now moving forward, I want you to simply test the binding by setting the print string node to say “hello”, as shown in the picture

Then when you PRESS PLAY - confirm that print string is firing off

If it fires - we’re in good shape and we can continue…

If it doesn’t fire - let me know and we’ll continue to trouble shoot

When you say “fire”, you mean spam. Because it’s like spamming*10^30

I’ve already tried this it was the same.

For you, the problem is WHEN I set the value.
But when you put a default value… (said before)?

Yuping this post

Yes, print string should be spamming - excellent - that means the widget has been successfully created at run time and the binding function is working as expected

With that now confirmed - delete the print string - and connect the “crosshair” variable to the input of the return node

Now - don’t expect to see anything appear just yet, because your “crosshair” variable contains no information (unless it has a default value)

From there - you need to call the custom event that sets the “crosshair” variable. Not sure exactly where or how your doing this, but when its called and sets crosshair, at that point it should appear on screen as a text.

That said, what BP are you calling the custom events from? Also, when are they being called?

Sorry if I’m late.
I was calling the “Custom Events” from my “OptionMenu”.
They are called when you press one of the buttons.
So I think I need to wait before calling them, and call them when Player_UI is added to the player’s screen … It is right ?

Uping this question, cause I need help please…