Keeping spawned actors when changing scene
I am currently working on a game that requires the player to move from the main scene where the main actors are spawned, to a second scene to carry out other actions, before moving back to the main scene again. However the actors that had been spawned in the main scene disappear, how can I make them stay?
Thanks in advance
Comments
put the thing that made them spawn on the first scene on the second one... you should make a controller so you can manage everything easier!
I would, except I dont want those actors on the second scene, just the first scene
So I am not sure what the solution is?
See my demo here: http://forums.gamesalad.com/discussion/comment/506569/#Comment_506569.
The trick, though, with spawned actors would be to have a boolean or table value that changes when an actor is spawned and then have a rule in the spawner actor to spawn if those values have been changed.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I tried that. It remembers the position, but when I come back to the scene, the already spawned actor is gone. When the user spawns a new actor it is spawned to the saved attribute of the last one spawned.
The actor only spawns when the user touches it.
The demo saves the attribute, but I cannot get it to save the spawned actor. When the player taps on the actor to spawn it does spawn in the new saved attribute. I want it to spawn to the same place each time, and keep all the spawned.
Right, as I mentioned, you'd need to add to the demo. It doesn't do everything you want. It's just an example of how to store data for an actor's position.
Spawning is a bit trickier as I alluded to. You'll need to figure out a system for keeping track of which actor was spawned and what its position was when the scene changed, and then for re-spawning and moving the actor to that same position.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Use the attributes to re-spawn the actors in the correct location.