Skip to content

Commit 209c4cf

Browse files
committed
Made it so you can register replay rigids without having to also smooth them
1 parent f1a0026 commit 209c4cf

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Runtime/Code/Player/Character/MovementSystem/ClientPrediction/AirshipPredictionRigidbodyController.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,17 @@ private void Awake() {
2626
if(!rigid) {
2727
rigid = gameObject.GetComponent<Rigidbody>();
2828
}
29-
if(!graphicsHolder) {
30-
Debug.LogWarning("Rigidbody is missing graphics holder and won't be smoothed or handled by client side prediction. GameObject: " + gameObject.name);
31-
}
3229
}
3330

3431
private void OnEnable() {
35-
if(rigid && graphicsHolder){
36-
//Register for rigidbody smoothing
37-
AirshipPredictionManager.instance.RegisterRigidbody(rigid, graphicsHolder);
38-
32+
if(rigid){
3933
//Listen to replays
4034
AirshipPredictionManager.instance.RegisterPredictedObject(this);
35+
36+
if(graphicsHolder){
37+
//Register for rigidbody smoothing
38+
AirshipPredictionManager.instance.RegisterRigidbody(rigid, graphicsHolder);
39+
}
4140
}
4241
}
4342

Runtime/Code/TSCodeGen/TypeGenerator.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ private static void GenerateTypes() {
245245
typeof(AccessoryComponent),
246246
typeof(ActiveAccessory),
247247
typeof(CharacterMovementState),
248+
typeof(AirshipPredictionManager),
248249

249250
// Steam
250251
typeof(AirshipSteamFriendInfo),

0 commit comments

Comments
 (0)