Acloed
(MikeyMike)
January 2, 2024, 10:44am
1
Hey there!
This is a silly question, but I have no idea why my random integer node keeps firing constantly.
Here’s a screenshot:
Thank you in advance!
It will fire for each thread you have coming from it
If you want it to stay put, just store the result in a variable.
Acloed
(MikeyMike)
January 2, 2024, 10:59am
3
That’s what I thought. Just wanted to see if there’s a better way to do it
Everynone
(Everynone)
January 2, 2024, 11:00am
4
Function bindings execute every frame. Avoid it. Generate the result when needed and update the text only once.
Acloed
(MikeyMike)
January 2, 2024, 11:07am
6
what’s the text block var? Also, I only managed to find “Set Tool Tip Text”
Everynone
(Everynone)
January 2, 2024, 11:07am
7
It’s the text block displaying the text.
Sitiana
(Sitiana)
January 2, 2024, 11:08am
8
Just cache your value to a local int, so it will be selected randomly only once:
Or use switch on Int:
Everynone
(Everynone)
January 2, 2024, 11:09am
9
This will not work if OP is using function binding.
Which I’m almost certain they do:
Right?
Acloed
(MikeyMike)
January 2, 2024, 11:11am
10
You’re right, that’s what I’m doing. I followed your steps, but have an error:
Everynone
(Everynone)
January 2, 2024, 11:12am
11
Remove the binding. Also, you’re setting the Tooltip text - is that intentional?
Do not use binding at all for this. it fires 60 times per second - you’d be generating the result that often.
Acloed
(MikeyMike)
January 2, 2024, 11:16am
12
Ok, I’ve found the original Set Text node. However, I’m still unable to create a custom event in the widget’s event graph
Everynone
(Everynone)
January 2, 2024, 11:17am
13
unable to create a custom event in the widget’s event graph
You may not even need it, tbh. Call the function directly when you need the text updated / generated. Seeing this is some kind of event that is supposed to pop up (right?), you may be able to keep it as simple as:
Other than that, you may need to explain when / how this is supposed to trigger.
Acloed
(MikeyMike)
January 2, 2024, 11:18am
14
Had to reopen the blueprint. I guess it was a bug
Acloed
(MikeyMike)
January 2, 2024, 11:20am
15
Thank you. You’ve been a big help. It works now!