mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 19:10:32 +00:00
PredictedRigidbody: make .predictedRigidbody accessible to other components!
This commit is contained in:
parent
00069b9c7c
commit
7702db6e03
@ -24,7 +24,12 @@ public enum CorrectionMode
|
|||||||
public class PredictedRigidbody : NetworkBehaviour
|
public class PredictedRigidbody : NetworkBehaviour
|
||||||
{
|
{
|
||||||
Transform tf; // this component is performance critical. cache .transform getter!
|
Transform tf; // this component is performance critical. cache .transform getter!
|
||||||
protected Rigidbody predictedRigidbody; // always valid, even while moved onto the ghost.
|
|
||||||
|
// Prediction sometimes moves the Rigidbody to a ghost object.
|
||||||
|
// .predictedRigidbody is always kept up to date to wherever the RB is.
|
||||||
|
// other components should use this when accessing Rigidbody.
|
||||||
|
public Rigidbody predictedRigidbody;
|
||||||
|
|
||||||
Vector3 lastPosition;
|
Vector3 lastPosition;
|
||||||
|
|
||||||
// motion smoothing happen on-demand, because it requires moving physics components to another GameObject.
|
// motion smoothing happen on-demand, because it requires moving physics components to another GameObject.
|
||||||
|
Loading…
Reference in New Issue
Block a user