Skip to content

Commit

Permalink
fix(Portal): Wait for RemovePlayerForConnection to process
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGadget1024 committed Dec 29, 2024
1 parent 9e3a283 commit bf66988
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Assets/Mirror/Examples/AdditiveLevels/Scripts/Portal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ IEnumerator SendPlayerToNewScene(GameObject player)
// Remove player after fader has completed
NetworkServer.RemovePlayerForConnection(conn, RemovePlayerOptions.Unspawn);

// yield a frame allowing interest management to update
// and all spawned objects to be destroyed on client
yield return null;

// reposition player on server and client
player.transform.position = startPosition;

Expand Down

0 comments on commit bf66988

Please sign in to comment.