FirstGearGames / FishNet

FishNet: Unity Networking Evolved.
Other
1.39k stars 150 forks source link

V2 Prediction: Rigidbody isKinematic=true when it shouldn't. #637

Closed viliwonka closed 7 months ago

viliwonka commented 8 months ago

Important

Replication,

General Unity version: 2022.3.17f Fish-Networking version: 4.1.6 Discord link: https://discord.com/channels/424284635074134018/1167060429051269200/1224658034999955477

Description I have multiple CSP (player and vehicle). Vehicles owner is at first null (none), then Player takes ownership of it (so that client starts CSP on it).

Replication Steps to reproduce the behavior:

  1. Two CSPed objects (player & vehicle). Player is owned, vehicle has no owners.
  2. Player takes ownership of vehicle.
  3. When Replay happens, [Reconcile] Debug.Log reports, that RigidBody is kinematic, in ReplayCurrent.
  4. This means Vehicle starts jittering hard on client.

Expected behavior The Vehicle RB should not be kinematic, when it does ReplayCurrent.

Hot fix

Inside [Replicate] function, at start, I apply this:

            if(replicateState == ReplicateState.ReplayedCreated)
                this.NetworkObject.RigidbodyPauser.Unpause();
FirstGearGames commented 7 months ago

Do you have a project I can work with?

FirstGearGames commented 7 months ago

Resolved in 4.2