Getting multiple values instead of one. I have no clue why

Hello! So I’ve got a BP that currently places multiple mesh instances. It looks something like this.

Now when I try to get the number of instances of the Roof Corner like so
image
Upon printing that I get these values.
image
Why am I getting multiple values like that? Shouldn’t it just show the final number? Like 16?

Shouldn’t it just show the final number?

Yes. Unless you query it while these are being added. I sense you have 4 corners and query it 4 times.

Can we peek at this part?


Here you go

What is this connected to? You see 4 prints, it’s done 4 times.


image
“Then 4”

Hard to tell without seeing how the data flows but you do run it 4 times. Put a print string right after Then 4 → how many times does it fire? If more than once, you need to go further back and see why build floors fires more often than it should.

I get what you mean but why would the values still change? Shouldn’t I just get 16 4 times then?

1 Like

Because each iteration adds more instances. This might be a critical bug to solve. Place breakpoints and step through the script.

Find the place that actually adds the instances and see whether it fires as often as you’d expect.

Is it possible this is actually correct:

There are 16 corners here. Each loop adds 4.

So I just tested printing it before I use the for loop, I get just 16. This also means that Build Floor is only being fired once since if it was being fired multiple times. The number of instances would be higher than 16 in the Then 2 pin.

I think I might just do what I’m trying to do outside the for loop and use the Then 2 pin

1 Like

If 16 is the correct number you expect, indeed, you may simply query it inside the creation loop.

Wait huh? What do you mean by query it inside the creation loop?

Judging by the print string output, you’re doing this atm:

But you want this: