From 8591e2136c36ab8220423b20d5efbf35393bac85 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Sat, 17 Jul 2021 09:49:36 +0100 Subject: [PATCH] add root identity set to unparentedbaserigidbodysync --- QSB/Syncs/RigidbodySync/UnparentedBaseRigidbodySync.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/QSB/Syncs/RigidbodySync/UnparentedBaseRigidbodySync.cs b/QSB/Syncs/RigidbodySync/UnparentedBaseRigidbodySync.cs index a80f57a8..bd0bd3c3 100644 --- a/QSB/Syncs/RigidbodySync/UnparentedBaseRigidbodySync.cs +++ b/QSB/Syncs/RigidbodySync/UnparentedBaseRigidbodySync.cs @@ -1,7 +1,9 @@ using OWML.Common; using OWML.Utils; +using QSB.Player.TransformSync; using QSB.Utility; using QuantumUNET.Transport; +using System.Linq; using UnityEngine; namespace QSB.Syncs.RigidbodySync @@ -17,6 +19,10 @@ namespace QSB.Syncs.RigidbodySync public virtual void Start() { + var lowestBound = Resources.FindObjectsOfTypeAll() + .Where(x => x.NetId.Value <= NetId.Value).OrderBy(x => x.NetId.Value).Last(); + NetIdentity.SetRootIdentity(lowestBound.NetIdentity); + DontDestroyOnLoad(gameObject); _intermediaryTransform = new IntermediaryTransform(transform); QSBSceneManager.OnSceneLoaded += OnSceneLoaded;