set vehicle's rigid body CollisionDetectionMode to continuous dynamic

This commit is contained in:
in0finite 2021-02-06 02:39:56 +01:00
parent af54f74847
commit 3e73a557f2
3 changed files with 4 additions and 0 deletions

View file

@ -89,6 +89,7 @@ MonoBehaviour:
cameraDistanceFromVehicle: 7
rigidbodyInterpolationOnServer: 0
rigidbodyInterpolationOnClient: 1
rigidBodyCollisionDetectionMode: 2
syncLinearVelocity: 1
syncAngularVelocity: 1
whenToDisableRigidBody: 0

View file

@ -14,6 +14,8 @@ namespace SanAndreasUnity.Behaviours.Vehicles
public RigidbodyInterpolation rigidbodyInterpolationOnServer = RigidbodyInterpolation.None;
public RigidbodyInterpolation rigidbodyInterpolationOnClient = RigidbodyInterpolation.None;
public CollisionDetectionMode rigidBodyCollisionDetectionMode = CollisionDetectionMode.Discrete;
public bool syncLinearVelocity = true;
public bool syncAngularVelocity = true;
public Utilities.WhenOnClient whenToDisableRigidBody = Utilities.WhenOnClient.OnlyOnOtherClients;

View file

@ -34,6 +34,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
_rigidBody = gameObject.GetComponent<Rigidbody>();
_rigidBody.interpolation = Net.NetStatus.IsServer ? VehicleManager.Instance.rigidbodyInterpolationOnServer : VehicleManager.Instance.rigidbodyInterpolationOnClient;
_rigidBody.collisionDetectionMode = VehicleManager.Instance.rigidBodyCollisionDetectionMode;
if (Net.NetStatus.IsClientOnly)
{