Not Spawning at Spawnpoint

The code im using is exactly the same as the one in Github, I have also added the Spawpoint to the [SerializeField]. My player is ignoring the Spawnpoint, it seems that the scene is loading twice, because somethimes it appears in the Spawnpoint but it inmeadiatly loads to the original place of the player.

There is nothing appearing on the console either.

When the scene loads in the Hierarchy Tab i can see that two instances of the scene loading are appearing

If i try it enough times, 1 out of 5to6 attemps, it loads at the right spawnpoint

So i just came with a solution, something was going wrong with

private IEnumerator Transition()
        {
            yield return SceneManager.LoadSceneAsync(sceneToLoad);
 
        }

So i just decided to update de Players position when the Scene was loaded using this code

void OnSceneLoaded(Scene scene, LoadSceneMode mode)
    {
            
        Portal otherPortal = GetOtherPortal();
        UpdatePlayer(otherPortal);
             
    }

It solved the problem

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

Privacy & Terms