What am I doing wrong with this blueprint?
All I am trying to do is populate an array from another array of “options”. It loops for the total army size.
At least, it’s supposed to. It’s populating the “Army Units” array with 1200 “none” fields, and i cant figure out why. i have no blank fields in the Unit Options array and I dont reference 1200 ANYWHERE in the blueprint.
The army size is randomly selected between 20 and 50, and the Unit options array only has 4 actors contained in it…
Am i just missing something that is glaringly obvious?
That did it! Thanks to your guys’ help, I got a solution!
Thank you guys very much! Its so simple, sometimes you just need another pair of eyes to see the problem(:
I’ll probably update the random int. to grab from the last index like LordStuff recommended.
You’re right! I initially had this on begin play I think, but I must’ve swapped it over to tick just to see print string the array length to make sure it was working right.
why are you running this on tick? it seems like your trying to make a array of units basically initializing it. so that would be something that in my mind you would do once then not need to do again. now it may not be a huge performance hit it to check the array length on tick but its a rather simple thing to solve as well.
right now your basically asking is condition true every frame(30-120 times per second roughly), you could instead do the same script on begin play and it will run once and never run again.