Prediction: expose physics copy components to inheriting classes

This commit is contained in:
mischa 2024-02-02 09:07:31 +01:00
parent d00af697bb
commit fcea3ce9d4

View File

@ -87,9 +87,9 @@ public class PredictedRigidbody : NetworkBehaviour
// Rigidbody & Collider are moved out into a separate object.
// this way the visual object can smoothly follow.
protected GameObject physicsCopy;
Transform physicsCopyTransform; // caching to avoid GetComponent
Rigidbody physicsCopyRigidbody; // caching to avoid GetComponent
Collider physicsCopyCollider; // caching to avoid GetComponent
protected Transform physicsCopyTransform; // caching to avoid GetComponent
protected Rigidbody physicsCopyRigidbody; // caching to avoid GetComponent
protected Collider physicsCopyCollider; // caching to avoid GetComponent
float smoothFollowThreshold; // caching to avoid calculation in LateUpdate
// we also create one extra ghost for the exact known server state.