[RelativeSync] Fixed sitting in chair sometimes interpolating weirdly

This commit is contained in:
NotAKidoS 2024-05-29 17:26:35 -05:00
parent 974fefd896
commit f1dd196304
2 changed files with 3 additions and 3 deletions

View file

@ -154,10 +154,10 @@ public class RelativeSyncController : MonoBehaviour
// set last sync data to current position and rotation so we don't lerp from the last marker // set last sync data to current position and rotation so we don't lerp from the last marker
_lastSyncData.LocalRootPosition = relativePosition; _lastSyncData.LocalRootPosition = relativePosition;
_lastSyncData.LocalRootRotation = relativeRotation; _lastSyncData.LocalRootRotation = relativeRotation;
_lastUpdate = Time.time; // reset update time
} }
public void SetRelativePositions( public void SetRelativePositions(Vector3 position, Vector3 rotation)
Vector3 position, Vector3 rotation)
{ {
// calculate update interval // calculate update interval
float prevUpdate = _lastUpdate; float prevUpdate = _lastUpdate;

View file

@ -28,8 +28,8 @@ public static class RelativeSyncManager
RelativeSyncMarker syncMarker = null; RelativeSyncMarker syncMarker = null;
if (target != NoTarget) RelativeSyncTransforms.TryGetValue(target, out syncMarker); if (target != NoTarget) RelativeSyncTransforms.TryGetValue(target, out syncMarker);
controller.SetRelativePositions(position, rotation);
controller.SetRelativeSyncMarker(syncMarker); controller.SetRelativeSyncMarker(syncMarker);
controller.SetRelativePositions(position, rotation);
} }
public static void GetRelativeAvatarPositionsFromMarker( public static void GetRelativeAvatarPositionsFromMarker(