Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix clientsim spawn bug #82

Merged
merged 1 commit into from May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -285,6 +285,7 @@ private IEnumerator InitializeClientSim()
if (_player)
{
_player.isInstanceOwner = _settings.isInstanceOwner;
_sceneManager.ResetSpawnOrder(); // Avoids any spawn offsets from pre-initialization of players
_player.EnablePlayer(_sceneManager.GetSpawnPoint(false));
}
}
Expand Down
Expand Up @@ -80,6 +80,11 @@ public bool ShouldObjectsDestroyAtRespawnHeight()
return _descriptor.ObjectBehaviourAtRespawnHeight == VRC_SceneDescriptor.RespawnHeightBehaviour.Destroy;
}

public void ResetSpawnOrder()
{
_spawnOrder = 0;
}

public Transform GetSpawnPoint(bool remote = false)
{
if (!HasSceneDescriptor())
Expand Down