DoOnce and Do N node giving error and not compiling

Im trying to follow a tutorial to learn how to use blueprints and they are teaching me about DoOnce nodes and DoN. Im suppose to get a value from my array to show on the screen once using DoOnce or DoN but when I compile it there is an error and i dont know why. in the video it works perfectly and im doing the exact same thing.

Hey @Katukaz!

What does it tell you when you mouse over the red ERROR! bar?

It could be that it’s on tick- you probably don’t want to run N 60x/second.

Try using a different event - just do a key press event like one of the number keys or something to test it - and see if the error goes away!

when i mouse over it it says “The type of Variable generated from expanding Do Once is undetermined. Connect something to Assign generated from expanding Do Once to imply a specific type.” and if I click the word variable it shows an error on the assign node.

also in the tutorial im watching you can see i have the exact same setup in the blueprints and in the video it compiles fine

“Do N” is a wrapper on “Do Once” (it has some of the most counter intuitive Pin Labels, why they allowed it to be looped is also funny) I always find it special that these nodes don’t have the exception path or Fail path, requiring a Sequence Node to make sense (I would even speculate that it is nodes like “Do Once” and “Do N” are the only practical uses of Sequence).
the “working” example is the “Do Once”, you are showing an issue with a “Do N”

In the Standard Macro (where the editor is pointing to) take the “Local Boolean::Variable” and plug it into the Assign(Variable) pin. the only reason that would not be connected is if it was manually disconnected within your project or in your Engine install, or your install is corrupted in a very specific way (so that everything else still works, but that one standard function)

even having a limiter on the operation Like a “Do N” in Tick() is still not great, because the Tick() will get to the node and have to spend computation steps to figure out if it needs to do the thing “inside” the “exit” (why has this Label not been fixed yet). if you are going to use these type of nodes don’t do them in Tick(), as it is the type of thing that makes Tick() into the overused anchor, and why Delay is suggested (which is constrained Tick() without groups, and extra steps)

1 Like

Thank you so much that did work! Also I have tried doing the exact same thing in a new project and it also came up with an error and the same steps you said were the only way to fix it. As im new to all this i have not moved or touched any nodes everything is default on all projects so idk why its disconnected by default for me. Im also on the latest version of unreal.

1 Like