Moving back to a level after traveling through

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
FierceDiodes
Posts: 4
Joined: Mon Dec 06, 2021 9:11 pm

Moving back to a level after traveling through

Post by FierceDiodes »

Hello, I am still relatively new to this Dialogue system, but I have a solid understanding of everything except for the save system. So I have three scenes that I want my character to be able to travel between. All goes well when I go forward between my spawn points, with scene1 to scene2 loading to the correct start spawn point, then from scene2 to scene3 with its starting spawn point. However, when I go back from scene2 to scene1, I spawn where my player Gameobject is placed in the level before runtime, but turned the correct direction of the intended spawn point. Then, when I go back from Scene1 to Scene2, I end up in the same situation where I am turned correctly but am in the wrong position. I've used the debug option and it even outputs the correct spawn point name, it just doesn't get the correct position.
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Moving back to a level after traveling through

Post by Tony Li »

Hi,

Thanks for using the Dialogue System!

It's strange that going forward (scene1 to scene2 to scene 3) puts the player in the correct spawnpoint position but going backward doesn't.

Does the player's design-time position or backward spawnpoint (e.g., spawnpoint in scene 2 from scene 3) overlap with a Scene Portal or something like that?

(Note: I'm finishing work for the night, but I'll check back in the morning.)
FierceDiodes
Posts: 4
Joined: Mon Dec 06, 2021 9:11 pm

Re: Moving back to a level after traveling through

Post by FierceDiodes »

Thank you for the quick reply! I am not using scene portals, I am using a door with a Dialogue system trigger that plays a sequence on use. I also made sure none of the spawn points overlap with the sphere colliders of the doors. Could it be related to my project being hosted on source control (Perforce)?
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Moving back to a level after traveling through

Post by Tony Li »

Hi,

No, I don't think it has anything to do with version control. Most projects use version control. (And all should! ;))

What is the sequence? Are you using the LoadLevel() sequencer command?

Are there any errors or warnings in the Console window?
FierceDiodes
Posts: 4
Joined: Mon Dec 06, 2021 9:11 pm

Re: Moving back to a level after traveling through

Post by FierceDiodes »

Attached below are the scripts for my objects in the scene, with the dialogue manager, Player object, and the two door objects, and the console log. I started by spawning the player into the diner at the entrance from a menu screen. The player then walks to the doorObject to go out to the park at the spawnpoint "FromDiner". This spawns the player in the correct position. Then, the player goes to the park door back to the diner to be spawned at the spawn point "Diner exit spawnpoint." The player spawns at the correct position for a split second, then seems to teleport to where the player is placed in the scene view. Then, when I go back out to the park from the diner, the previously working park spawnpoint no longer works. I can record a video demonstration if that would help as well.
Attachments
Log.png
Log.png (30.85 KiB) Viewed 464 times
Screenshot 2021-12-07 132940.png
Screenshot 2021-12-07 132940.png (92.8 KiB) Viewed 464 times
PlayerComponents.png
PlayerComponents.png (115.31 KiB) Viewed 464 times
Park Door.png
Park Door.png (46.25 KiB) Viewed 464 times
doorObject.png
doorObject.png (47.85 KiB) Viewed 464 times
FierceDiodes
Posts: 4
Joined: Mon Dec 06, 2021 9:11 pm

Re: Moving back to a level after traveling through

Post by FierceDiodes »

I forgot to mention, but for the player object I am using the Unity FPS Starter asset with a cinemachine follow camera. I don't know if this has anything to do with it, but it seems like with adding to the transition time on scene loading, it places the character in the correct place for two seconds, then teleports them to where it is placed in the scene view: https://assetstore.unity.com/packages/e ... ler-196525
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Moving back to a level after traveling through

Post by Tony Li »

Hi,

I just tested it with the FirstPersonController Starter Asset, and spawnpoints work correctly.

Since you say it moves the player to the spawnpoint before moving it back, I won't ask if you added a PositionSaver to the PlayerCapsule, set its Key to a unique value, and ticked Use Player Spawnpoint.

Instead, would it be possible for you to send a reproduction project to tony (at) pixelcrushers.com?
Post Reply