Why is this construction script executing twice?

Alright, what I’m trying to do is use a blueprint construction script to spawn a number of other blueprints as child actors. Specifically, I’m making a simple breakout/arkanoid clone for practice. I have a Brick blueprint that contains some basic logic to spawn an effect and destroy itself when hit, and a BrickField blueprint that spawns a number of Bricks as child actors according to settable variables in ordered rows and columns.

Now, the problem is: if I spawn these child actors in the construction script, they seem to be spawned twice, as can be seen in the Scene Outliner window and by the fact that there are flickering colors. If I move the exact same network of nodes from the construction script to an Event Begin Play node in the regular EventGraph, they only spawn once.

Here’s the script:

http://stuff.pyrron.com/brickfield-bug.jpg

([Full size][3])

As I said, if I take that exact network, copy it, and attach it to an Event Begin Play node, it works as intended.

Here are the assets and blueprints in question: [http://stuff.pyrron.com/BrickField-Bug.rar][2]

Does anyone know what’s wrong with that? Is it an engine/editor bug, or is it a problem with my blueprint? Any help would be appreciated.

Edited to add: The spawn actor from class node in the Brick blueprint just spawns a particle effect, just delete it or assign a random one if you’re getting compile errors.

It’s a full size image, it’s just scaled down by this website. I’ve added a link to it as well for ease of use.

I had a similar problem in my Game Mode blueprint. It was executing the Construction Script twice and the Begin Play event three times, even if the only thing I had hooked up to them was a Print String. What fixed it for me was finding that there were actually 3 different Game Mode blueprints in my Content folder, even though it showed that there was only one in the Content Browser. I think what happened was Unreal Engine was creating hidden copies of the blueprint whenever I would copy and rename the blueprint from within the Content Browser. I just deleted the extraneous blueprints and it started running just once again. Hope that helps.

Those additional uassets are Redirectors.

This is from over 4 years ago, but yes, you’re right. I’m not even sure if comments were an option back then.

This should be a comment, not an answer.

I remember similar behaviour with adding child actors in construction script leading to me going all EventGraph + SpawnActor because after I got the construction script finally running and PIE bug free I hit a wall in the cooked multiplayer test.

Is this Singleplayer or could it be a replication?

Also your math is way to complex and hard to read. Seems to me at least half of these nodes are unnessessary (just go actor location + (index * ). If you did not mention it working in EventBeginPlay I wouldve assumed its the messy math.

EDIT: wow answerhub tricked me into digging out an 2014 question again, my bad :smiley:

Not sure if it is just me, but I can’t get the attached image to be any larger, making it impossible see the nodes. I probably can’t help with your problem, but just pointing that out.

Your wish is my command =)