DoOnce firing multiple times in construction script

My do once node is firing multiple times in my construction script.

Is this because every time you reposition it it essentially resets the graph?

I’m trying to get the object to be scaled up just once on creation, but then set the rotation every time I move it. Perhaps this isn’t possible. I can check for scale if this is the case.

Hey -

The construction script doesn’t necessarily reset, however it does retrigger every time you move the object, so you are mostly correct in your thoughts. One possible solution is if you tie your scale to a boolean that is initially set to false. When you pull your object into the level, you can do a check that if it is false, then do the scale and set the boolean to true. As long as you have nothing that resets the variable to false, it should only fire the scale when the object is created.

The problem is that when you move the object in the level it causes the construction script to trigger from the beginning. Thus the DoOnce node will fire upon placing the object in level and when you move the object after creation, it will fire once more when the entire construction script triggers.

Surely though, if it’s merely firing again the DoOnce should work. Why isn’t it?

So in essence it is resetting. But then it also saves state? but flow is not part of that state. only things that can be serialized like data types. is that right?

My apology, it seems that setting the boolean as I suggested would not work as intended. When you move the object after it has been created it reverts its values to their defaults before running the construction script. In other words moving the object around within the level has the same effect as having just pulled the blueprint from the content browser into the level, as far as the construction script is concerned. So the boolean that I suggested would also trigger again each time it is moved. There may be other solutions to what is going on, what are you trying to have your blueprint do exactly?

I actually solved it by scaling the asset in the mesh editor. For future reference to anyone else, the way to do this would be to have the blueprint check for the current scale and only increase it if it was below a certain threshold.