mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-03-05 07:37:17 +00:00
Disable ped transform syncing while in vehicle
This commit is contained in:
parent
d76320682a
commit
7f5b37f85e
2 changed files with 8 additions and 0 deletions
Assets/Scripts/Behaviours/Ped/States
|
@ -21,6 +21,9 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
m_ped.characterController.enabled = true;
|
||||
m_ped.transform.SetParent(null, true);
|
||||
m_model.IsInVehicle = false;
|
||||
// restore sync interval for network transform
|
||||
if (m_ped.NetTransform != null)
|
||||
m_ped.NetTransform.syncInterval = m_ped.DefaultTransformSyncInterval;
|
||||
}
|
||||
|
||||
if (this.CurrentVehicleSeat != null && this.CurrentVehicleSeat.OccupyingPed == m_ped)
|
||||
|
|
|
@ -40,6 +40,11 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
|
||||
ped.PlayerModel.IsInVehicle = true;
|
||||
|
||||
if (!VehicleManager.Instance.syncPedTransformWhileInVehicle) {
|
||||
if (ped.NetTransform != null)
|
||||
ped.NetTransform.syncInterval = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public bool TryEnterVehicle(Vehicle vehicle, Vehicle.SeatAlignment seatAlignment, bool immediate = false)
|
||||
|
|
Loading…
Add table
Reference in a new issue