From 86412fbd82434a441b14e6a4f8601ba862881a2f Mon Sep 17 00:00:00 2001 From: Aleksander Waage Date: Fri, 14 Aug 2020 19:27:27 +0200 Subject: [PATCH] stupid crap --- QSB/Tools/QSBProbe.cs | 2 +- QSB/TransformSync/PlayerSectorEvent.cs | 2 +- QSB/TransformSync/TransformSync.cs | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/QSB/Tools/QSBProbe.cs b/QSB/Tools/QSBProbe.cs index ab3cc180..2a19381e 100644 --- a/QSB/Tools/QSBProbe.cs +++ b/QSB/Tools/QSBProbe.cs @@ -23,7 +23,7 @@ namespace QSB.Tools private void Deactivate() { - gameObject.SetActive(false); + //gameObject.SetActive(false); } } diff --git a/QSB/TransformSync/PlayerSectorEvent.cs b/QSB/TransformSync/PlayerSectorEvent.cs index 5fda066f..e436d034 100644 --- a/QSB/TransformSync/PlayerSectorEvent.cs +++ b/QSB/TransformSync/PlayerSectorEvent.cs @@ -36,7 +36,7 @@ namespace QSB.TransformSync var transformSync = PlayerRegistry.GetTransformSync(message.SenderId); DebugLog.ToScreen($"{transformSync.GetType().Name} of ID {message.SenderId} set to {message.SectorName}"); - transformSync.ReferenceTransform = sector.transform; + transformSync.SetReference(sector.transform); } public override void OnReceiveLocal(SectorMessage message) => OnReceiveRemote(message); diff --git a/QSB/TransformSync/TransformSync.cs b/QSB/TransformSync/TransformSync.cs index 490a3934..e731a710 100644 --- a/QSB/TransformSync/TransformSync.cs +++ b/QSB/TransformSync/TransformSync.cs @@ -101,5 +101,11 @@ namespace QSB.TransformSync SyncedTransform.localRotation = QuaternionHelper.SmoothDamp(SyncedTransform.localRotation, transform.rotation, ref _rotationSmoothVelocity, Time.deltaTime); } + public void SetReference(Transform sectorTransform) + { + ReferenceTransform = sectorTransform; + _positionSmoothVelocity = Vector3.zero; + _rotationSmoothVelocity = Quaternion.identity; + } } }