remembering spawned actor positions after scene change
xotty9999
Member, PRO Posts: 15
I am working on a farm like game. The idea is to plant seeds in a field, but it also has scene changes to go to a store, check statuses, etc. Once an actor is spawned, usually it will be several instances of the same actor--that is, planting 3 apple trees, lets say, in a field. How can you design the game so that if you change a scene and then come back to the original scene where the 3 apple trees were spawned, those actors will be in the same positions?
Comments
id use pause game behavior instead of change scene , works better in this case
Thank you for your idea, but I am definitely going to do change scene behavior. It is a farm game and the player will need the opportunity to buy pesticides, use ladybugs, fertilize, etc., by exiting the scene and purchasing items at a store. But when she/he comes back to the field/farm scene, it will be expected that the apple trees will be where they were planted.
The Pause Game behavior is intended for exactly that kind of situation. You pause the game and overlay another scene (e.g. a "store") and then unpause to resume right where you left off.
It's possible -- but much more complex -- to pause every single actor manually and/or respawn all existing actors in their previous spots without the use of the Pause Game behavior.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
OK. As I am a newbie, I was not familiar that the pause game behavior was anything more than literally pausing the game while you say, go let the dog out or something. I will give it a try and let everyone know how it goes.
Thanks in advance!
Just tried it on an experimental project and it will work perfectly for what I want to do. Thank you both!
The question of course is, if the player does need to take the dog out and goes for a walk and then plays the game later -- is it still the same game? Do the trees still need to be in the same place? If so, the Pause behavior does not solve your issue at all. It won't save the location of the trees. It will only mean that the position doesn't get reset when a scene is 'changed.'