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
Okay,
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 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
Okay,
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
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
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 ?