mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-10 06:34:16 +00:00
disable nav mesh agent while ped is in vehicle
This commit is contained in:
parent
2fb543ef0a
commit
3561f0657a
1 changed files with 3 additions and 1 deletions
|
@ -135,6 +135,8 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
|
||||
F.RunExceptionSafe( () => vehicle.OnPedPreparedForVehicle(ped, seat) );
|
||||
|
||||
ped.NavMeshAgent.enabled = false;
|
||||
|
||||
}
|
||||
|
||||
protected void Cleanup()
|
||||
|
@ -144,11 +146,11 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
m_ped.characterController.enabled = true;
|
||||
m_ped.transform.SetParent(null, true);
|
||||
m_model.IsInVehicle = false;
|
||||
// enable network transform
|
||||
if (m_ped.NetTransform != null)
|
||||
m_ped.NetTransform.enabled = true;
|
||||
if (this.CurrentVehicle != null)
|
||||
F.RunExceptionSafe( () => this.CurrentVehicle.OnPedRemovedFromVehicle(m_ped, this.CurrentVehicleSeat) );
|
||||
m_ped.NavMeshAgent.enabled = true;
|
||||
}
|
||||
|
||||
if (this.CurrentVehicleSeat != null && this.CurrentVehicleSeat.OccupyingPed == m_ped)
|
||||
|
|
Loading…
Reference in a new issue