Skip to content

Commit

Permalink
fix: improving default timescale value and adding value to inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Frowen authored Feb 8, 2024
1 parent 63cdaa2 commit 35aae3e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Assets/NetworkPositionSync/Runtime/SyncPositionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ public class SyncPositionSystem : MonoBehaviour
[Header("Snapshot Interpolation")]
[Tooltip("Number of ticks to delay interpolation to make sure there is always a snapshot to interpolate towards. High delay can handle more jitter, but adds latancy to the position.")]
public float TickDelayCount = 2;


[Tooltip("How much to modify the timescale of interpolation clock when ahead or behind the server")]
public float TimeScaleModifier = 0.01f;

[Tooltip("SendToAll option skips visibility and sends position to all ready connections.")]
public SyncMode syncMode = SyncMode.SendToAll;

Expand All @@ -182,7 +185,7 @@ public InterpolationTime TimeSync

internal void Awake()
{
_timeSync = new InterpolationTime(1 / SyncRate, tickDelay: TickDelayCount, timeScale: 0.1f);
_timeSync = new InterpolationTime(1 / SyncRate, tickDelay: TickDelayCount, timeScale: TimeScaleModifier);
packer = new SyncPacker(PackSettings);
Behaviours = new SyncPositionBehaviourCollection(PackSettings);

Expand Down

0 comments on commit 35aae3e

Please sign in to comment.