Spawner Issues. Keeps destroying and respawning.

RuffleRuffle Member Posts: 1
edited January 2015 in Tech Support

Ok, I have four different color objects that go accross the screen. There is an object of one color at the top of the screen telling you which color object to tap. When you tap, let's say a red object, it changes the variables: "RedActive = False, RedDestroy = True." Now in the RedGoal actor I have set it so that: "If (RedDestroy == True) { GoalActive = 0 }" (Translate it to GameSalad. I prefer writing in C#)

Now in the spawner that creates the top object (The goal object) I have it set to this.

If(GoalActive == 0
{ ChangeAttribute(GoalRandom = random(1, 4);
If(GoalRandom == 1)
{ SpawnActor = RedGoal;
ChangeAttribute(RedActive = True);
ChangeAttribue(GoalActive = 1);
}
/*
2 is the same but set to blue
3 is to green
and 4 is to yellow
*/

After the fourth tap is gets into an endless cycle of destroying and spawning goal actors.

Just to pinpoint the problem a bit more:

After one goal actor has been spawned in once it will enter the cycle of destroy and spawn since if it spawns a red and then I tap a red and it spawns a red once more the red will immediately destroy itself and try and spawn another color.

What is should do is if the target color is red then when I tap on a red square in the bottom section of the screen it should delete the red goal at the top and spawn another color at random then let's say the random color was blue, it should then wait until I tap a blue square at the bottom section of the screen and it should delete the blue and spawn another color...and it goes on and on and on.

Please help!

Thanks,

Adam.

Comments

Sign In or Register to comment.