Spawning Actors Proper Solution?

Hello,

I'm starting working on a new game. It's a math game where pictures of objects are above and the matching numbers are below in a random order. The player drags the numbers at the bottom to the matching picture of objects and then solves the math problem.

I set up a table with the math problems in it and randomly select a row.

Here is where my problem is. I set up 12 actor "spawners" on the scene. They each look for the matching table cell value then spawn an actor with that number. I have a reset scene button where all the spawned actors get destroyed and the table is used again. The problem is that even though I have a .6 second delay after the actors are destroyed and the new actors are spawned a lot of the time the new actors are not spawned. About 1 out of 4 times everything works the rest of the time at least 1 or 2 actors are not spawned.

I know this is a hard question to answer without looking at the file but is there a better way to do this? Seems like I might be missing a more optimized way.

The added complexity comes because there may be more than one of a specific number on the scene at the same time, two number 5's for example, and either of the 5's below must be able to match either of the pictures of 5 objects above. So it's not always a one-to-one solution like a children's picture puzzle would be.

I hope I explained this clearly. I've been racking my brain on this for 2 days.

Thanks for any help you can offer.

Rich

Comments

  • richcoyrichcoy Member Posts: 211
    @sadida172

    Sorry, what you suggested is what I am doing. I have a boolean called reset and every actor that is spawned destroys when that boolean is true.

    It's not the destroy that's the problem it's the spawning after the destroy that does not seem to work well and makes me think there is another solution I have not thought of.

    Rich

Sign In or Register to comment.