Page 1 of 1
Realistic fps scene transfer
Posted: Mon Sep 19, 2016 8:38 pm
by thegamerguynz
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?
Re: Realistic fps scene transfer
Posted: Tue Sep 20, 2016 9:13 am
by Tony Li
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.
Re: Realistic fps scene transfer
Posted: Tue Sep 20, 2016 2:09 pm
by thegamerguynz
Awesome ill give that a go tonight! Thanks for your reply.
Re: Realistic fps scene transfer
Posted: Tue Sep 20, 2016 4:05 pm
by thegamerguynz
It worked perfectly thanks for your help.
Re: Realistic fps scene transfer
Posted: Tue Sep 20, 2016 7:22 pm
by Tony Li
Happy to help!