adjust code

This commit is contained in:
mischa 2024-01-28 12:37:20 +01:00
parent de45114cfb
commit 1f30306061

View File

@ -67,7 +67,8 @@ void FireWeapon()
{
// prediction: apply bullet force locally and send command to server
ApplyBulletForce(rigid, hit.normal, weapon.impactForce);
if (!isServer) CmdApplyBulletForce(predictedPhysics.target, hit.normal, weapon.impactForce); // not in host mode
PredictedRigidbody target = predictedPhysics.target.GetComponent<PredictedRigidbody>();
if (!isServer) CmdApplyBulletForce(target, hit.normal, weapon.impactForce); // not in host mode
}
}
}