PredictionRigidbody
This class provides accurate simulations and re-simulations when applying outside forces, most commonly through collisions.
Using outside the script
private void NetworkTrigger_OnEnter(Collider other)
{
// Add upward impulse when hitting this trigger.
if (other.TryGetComponent<RigidbodyPlayer>(out rbPlayer))
rbPlayer.PredictionRigidbody.AddForce(Vector3.up, ForceMode.Impulse);
// Do not call Simulate on the PredictionRigidbody here. That should only be done
// within the replicate method.
}Last updated