When to use TrueSyncManager.DeltaTime

Options
Hi,

I'm unclear when i need to use DeltaTime to keep players in sync. The docs use it as a multiplier when transforming an object, but the demo projects don't appear to. Could anyone shed some light?
TrueSyncManager.DeltaTime
Cheers

Comments

  • JeffersonHenrique
    Options
    Hi @feathers, you need to use if for some reason you want the same delta time in every client, but at first glance it not a common thing to use.
  • feathers
    Options
    thanks for the reply @JeffersonHenrique, would you please be able to explain the purpose in this part of code from the documentation?


    public override void OnSyncedUpdate () {
    FP accell = TrueSyncInput.GetFP (0);
    FP steer = TrueSyncInput.GetFP (1);

    accell *= 10 * TrueSyncManager.DeltaTime;
    steer *= 250 * TrueSyncManager.DeltaTime;

    tsTransform.Translate (0, 0, accell, Space.Self);
    tsTransform.Rotate (0, steer, 0);
    }

    Would everything still sync correctly without the DeltaTime multiplier?

    Cheers!
  • JeffersonHenrique
    Options
    Hi feathers, yeah it will sync, in this case we are using just like Time.deltaTime to get the time between frames, but you could remove it or multiply by change for different value (but not Time.deltaTime because this is not deterministic).