Hi guys just need some help transferring the player between scenes.
i've added the sync lua to fps script, but when it loads the new scene and loads the prefab, it's just the standard prefab.
i'm guessing i have to "save" the game before the level loads am i correct?
Realistic fps scene transfer
Re: Realistic fps scene transfer
Hi,
Yes. Before loading the old scene you need to save the player's data. Then after entering the new scene you need to reapply the saved data.
The easiest way to do this:
1. Make sure the Dialogue Manager GameObject has a Level Manager component.
2. Use the LoadLevel() sequencer command. This command uses Level Manager to load the level. A typical setup is to add a Sequence Trigger to a trigger collider such as a doorway. Set the Sequence Trigger to OnTriggerEnter, and set its Sequence field to "LoadLevel(yourNewLevel)".
If you don't want to use the LoadLevel() sequencer command, you can manually change levels by calling LevelManager.LoadLevel() in a script or event handler such as a UI button's OnClick() event.
Yes. Before loading the old scene you need to save the player's data. Then after entering the new scene you need to reapply the saved data.
The easiest way to do this:
1. Make sure the Dialogue Manager GameObject has a Level Manager component.
2. Use the LoadLevel() sequencer command. This command uses Level Manager to load the level. A typical setup is to add a Sequence Trigger to a trigger collider such as a doorway. Set the Sequence Trigger to OnTriggerEnter, and set its Sequence field to "LoadLevel(yourNewLevel)".
If you don't want to use the LoadLevel() sequencer command, you can manually change levels by calling LevelManager.LoadLevel() in a script or event handler such as a UI button's OnClick() event.
-
- Posts: 12
- Joined: Mon Sep 19, 2016 8:34 pm
Re: Realistic fps scene transfer
Awesome ill give that a go tonight! Thanks for your reply.
-
- Posts: 12
- Joined: Mon Sep 19, 2016 8:34 pm
Re: Realistic fps scene transfer
It worked perfectly thanks for your help.
Re: Realistic fps scene transfer
Happy to help!