Wrong Portal Spawn Position

Hello!

I just finished with all the cross scene reference portals, and they player is going to the right portal, mostly.
When I teleport to the second scene the player goes exactly to where they are supposed to, from either portal in the first scene. However, when the player goes back into the first scene from one of the portals in the second scene, he is in the completely wrong spot(He is not at (0, 0, 0 ), first spawn, or the other portals spawn). I am having trouble figuring out what is wrong as it is for only one out of three portals and there are very few distances between them. Thank you!

There are a few likely causes of what’s going on here…

First, make sure that all of your portals are in the root of the heirarchy. If they’re childed under a GameObject (much like we like to organize our scenes), they can’t be tagged as DontDestroyOnLoad(). Unity gives you a warning about this, but with all the warnings Unity gives about serialized fields never being assigned, Unity has sort of trained us not to look at warnings.

If that’s not the issue, make sure that the items in your PersistentObjectsPrefab are not in scene 2. They should only exist in the PersistentObjectsPrefab, and not be saved anywhere in the scene.

If that’s not it, it’s likely that a null reference message has been generated. Post that here and we’ll take the next steps to figuring out what the issue could be.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms