Random Integer Node Keeps Firing

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 :slight_smile:

If you want it to stay put, just store the result in a variable.

That’s what I thought. Just wanted to see if there’s a better way to do it

1 Like

Function bindings execute every frame. Avoid it. Generate the result when needed and update the text only once.

Nope, it’s by design :slight_smile:

what’s the text block var? Also, I only managed to find “Set Tool Tip Text”

It’s the text block displaying the text.

image

Just cache your value to a local int, so it will be selected randomly only once:

Or use switch on Int:

This will not work if OP is using function binding.

image

Which I’m almost certain they do:

Right?

You’re right, that’s what I’m doing. I followed your steps, but have an error:

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.

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

unable to create a custom event in the widget’s event graph

image

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.

Had to reopen the blueprint. I guess it was a bug

Thank you. You’ve been a big help. It works now!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.