Change scenes
Re: Change scenes
Hi,
Set a unique Key on your Saver.
Set a unique Key on your Saver.
-
- Posts: 62
- Joined: Wed Sep 25, 2024 11:26 pm
- Location: New York City
- Contact:
Re: Change scenes
Thanks. Although that does not improve my ability to spawn at the soawn point rather than the player position, it does get rid of that error message. Can you direct me to any explanation of what those keys are for?
Re: Change scenes
Each Saver component saves its data in the save system under a lookup key value. If you don’t specify a key, it will use the GameObject name. If two savers on the same GameObject don’t have keys, they’ll overwrite each other’s data.
For the spawnpoint issue, if you’re comfortable using a code debugger to step through code, I can provide further steps. Otherwise I’ll need a reproduction project to help.
For the spawnpoint issue, if you’re comfortable using a code debugger to step through code, I can provide further steps. Otherwise I’ll need a reproduction project to help.
-
- Posts: 62
- Joined: Wed Sep 25, 2024 11:26 pm
- Location: New York City
- Contact:
Re: Change scenes
Someone I'm making the game with is good at that and can try that next week. If that doesn't work I wouid be very happy to send you a reproduction project. Let's try stepping through the code first.
Re: Change scenes
Great! Put a breakpoint in Assets > Plugins > Pixel Crushers > Common > Scripts > Save System > Savers > PositionSaver.cs line 124, which is the first line of code in the ApplyData() method. Then reproduce the issue and step through the method to see if it calls the SetPosition() method to move the player to the spawnpoint. If so, step into the SetPosition() method to make sure it sets the position.
Also check the Console for a warning like: "Save System: Can't find spawnpoint..."
Also check the Console for a warning like: "Save System: Can't find spawnpoint..."
-
- Posts: 62
- Joined: Wed Sep 25, 2024 11:26 pm
- Location: New York City
- Contact:
Re: Change scenes
Does using the Scene Portal Component instead of The Dialogue System Trigger save data across scenes?
Re: Change scenes
If you've set up the save system, the Scene Portal component will use it. This means it will save the savers in the outgoing scene, change scenes, and then update the savers in the newly-loaded scene.
I'm not sure what you mean by using a Dialogue System Trigger. If you're using it to run Actions > Play Sequence and then using the LoadLevel() sequencer command to change scenes using the Dialogue System Trigger, then it will work similarly to a Scene Portal.
I'm not sure what you mean by using a Dialogue System Trigger. If you're using it to run Actions > Play Sequence and then using the LoadLevel() sequencer command to change scenes using the Dialogue System Trigger, then it will work similarly to a Scene Portal.
-
- Posts: 62
- Joined: Wed Sep 25, 2024 11:26 pm
- Location: New York City
- Contact:
Re: Change scenes
Yes, that's what I mean by using Dialogue System Trigger.
The odd thing is that the Portal component works perfectly and takes me to the indicated save point. Using LoadLevel() in the sequence as mentioned before, takes me to the Player's position not the save point.
So--I am saved! Because portal works.
But will still work through stepping through the LoadLevel() situation to see if can find out why its behavior is different.
Thank you so much for your patient help.
The odd thing is that the Portal component works perfectly and takes me to the indicated save point. Using LoadLevel() in the sequence as mentioned before, takes me to the Player's position not the save point.
So--I am saved! Because portal works.

But will still work through stepping through the LoadLevel() situation to see if can find out why its behavior is different.
Thank you so much for your patient help.
Re: Change scenes
Are you specifying the spawnpoint in LoadLevel(), such as:
(Edit: Removed quotation marks.)
Code: Select all
LoadLevel(Scene 2, Door Spawnpoint)
-
- Posts: 62
- Joined: Wed Sep 25, 2024 11:26 pm
- Location: New York City
- Contact:
Re: Change scenes
I don't have the quotation marks. I have it like this LoadLevel(Scene2, Door Spawnpoint). I will try with quotation marks. Thank you.