You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Runtime/Code/Player/Character/MovementSystem/ClientPrediction/AirshipPredictedController.cs
+33-15Lines changed: 33 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,9 @@ public abstract class AirshipPredictedController<T> : NetworkBehaviour, IPredict
42
42
[Tooltip("Optimization. Reduce the number of reconciles by only reconciling every N frames")]
43
43
publicintcheckReconcileEveryNthFrame=4;
44
44
45
+
[Tooltip("If true the object will replay after a forced reconcile. If false the object will clear its history and start over from the point of the server")]
46
+
publicboolreplayForcedReconciles=false;
47
+
45
48
[Tooltip("Applying server corrections one frame ahead gives much better results. We don't know why yet, so this is an option for now.")]
46
49
publicintserverSerializationOffset=1;
47
50
publicintreplayTickOffset=0;
@@ -119,6 +122,8 @@ public abstract class AirshipPredictedController<T> : NetworkBehaviour, IPredict
Copy file name to clipboardExpand all lines: Runtime/Code/Player/Character/MovementSystem/ClientPrediction/CharacterMovement/AirshipPredictedCharacterMovement.cs
+16-1Lines changed: 16 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,8 @@ public class AirshipPredictedCharacterMovement : AirshipPredictedController<Char
16
16
[Header("Character References")]
17
17
publicCharacterMovementmovement;
18
18
19
-
[Header("Variables")]
19
+
[Header("Character Variables")]
20
+
publicboolsnapPositionOnReconcile=true;
20
21
21
22
#endregion
22
23
@@ -195,6 +196,20 @@ public override void SnapTo(CharacterMovementState newState){
195
196
}
196
197
}
197
198
199
+
publicoverridevoidOnClientForcedReconcile(){
200
+
if(snapPositionOnReconcile){
201
+
print("Telling prediction to snap");
202
+
//Snap the movement so it doesn't lerp to the forced position
0 commit comments