Switching scenes causes spawned actors to disappear

tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
edited February 2012 in Working with GS (Mac)
So I'm finally getting around to creating a game that uses a scene more than once. In my initial scene, I spawn an actor multiple times that then checks for certain conditions and displays text as needed. I have another actor that switches to a text input scene and then back to the initial scene. When that happens and it goes back to the initial scene, the spawned actors are missing. I can tell because (a) my every 1 second --> log debugging statements stop appearing in the log window and (b) my alpha=1 actors no longer appear on the scene.

What's causing this? Do I need to respawn the actors whenever I switch to a scene I've already run? How do I do this without having too many copies of each actor.

In case it's not clear, here's an example: "control" actor spawns four copies of "check answer" actor and then destroys itself. An "input" actor switches to a different scene and then switches back to the initial scene, where the "check answer" actors are no longer there. Even if I turn off the destroy behavior, the "check answer" actors do not get respawned. That last part might be a rule error on my part, but I'm not sure that's the issue.

New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    is the switch scene done with a Pause Game or Change Scene?

    for four checkAnswer actors … think it might be easier to move them on/off screen

    @};- MH
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I'm using a change scene. I had tried it with a pause game and it did work, but I preferred change scene for what I was doing. The thing is, I don't need to ever get rid of the checkAnswer actors. That's the problem... I want them to stay but they disappear when I switch back to their scene.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I'm stubborn, I guess. Okay, I replaced it with a pause scene and all is well. I still don't understand why those actors didn't remain, but I'll go with what works.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.