Realistic fps scene transfer

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
thegamerguynz
Posts: 12
Joined: Mon Sep 19, 2016 8:34 pm

Realistic fps scene transfer

Post 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?
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Realistic fps scene transfer

Post 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.
thegamerguynz
Posts: 12
Joined: Mon Sep 19, 2016 8:34 pm

Re: Realistic fps scene transfer

Post by thegamerguynz »

Awesome ill give that a go tonight! Thanks for your reply.
thegamerguynz
Posts: 12
Joined: Mon Sep 19, 2016 8:34 pm

Re: Realistic fps scene transfer

Post by thegamerguynz »

It worked perfectly thanks for your help.
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Realistic fps scene transfer

Post by Tony Li »

Happy to help!
Post Reply