mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-12 22:50:44 -05:00
Prevent Bots from Running into Airdrop Crates (!46)
Adds a `NavMeshObstacle` component to airdrop boxes at the end of `OnBoxLand`. Without this change, bots run into the crates as if they aren't there (because they're dumb). Co-authored-by: dwesterwick <dwesterwick@yahoo.com> Reviewed-on: SPT-AKI/Modules#46 Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com> Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>
This commit is contained in:
parent
5544ae0c04
commit
deecc39107
@ -6,6 +6,7 @@ using EFT.Airdrop;
|
||||
using EFT.Interactive;
|
||||
using EFT.SynchronizableObjects;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
|
||||
namespace Aki.Custom.Airdrops
|
||||
{
|
||||
@ -145,6 +146,15 @@ namespace Aki.Custom.Airdrops
|
||||
Falloff = (int)surfaceSet.LandingSoundBank.Rolloff,
|
||||
Volume = surfaceSet.LandingSoundBank.BaseVolume
|
||||
});
|
||||
|
||||
AddNavMeshObstacle();
|
||||
}
|
||||
|
||||
private void AddNavMeshObstacle()
|
||||
{
|
||||
var navMeshObstacle = this.GetOrAddComponent<NavMeshObstacle>();
|
||||
navMeshObstacle.size = boxSync.CollisionCollider.bounds.size;
|
||||
navMeshObstacle.carving = true;
|
||||
}
|
||||
|
||||
private bool RaycastBoxDistance(LayerMask layerMask, out RaycastHit hitInfo)
|
||||
|
@ -15,6 +15,7 @@
|
||||
<Reference Include="Comfort" HintPath="..\Shared\Managed\Comfort.dll" Private="False" />
|
||||
<Reference Include="Sirenix.Serialization" HintPath="..\Shared\Managed\Sirenix.Serialization.dll" Private="False" />
|
||||
<Reference Include="UnityEngine" HintPath="..\Shared\Managed\UnityEngine.dll" Private="False" />
|
||||
<Reference Include="UnityEngine.AIModule" HintPath="..\Shared\Managed\UnityEngine.AIModule.dll" Private="False" />
|
||||
<Reference Include="UnityEngine.AnimationModule" HintPath="..\Shared\Managed\UnityEngine.AnimationModule.dll" Private="False" />
|
||||
<Reference Include="UnityEngine.AssetBundleModule" HintPath="..\Shared\Managed\UnityEngine.AssetBundleModule.dll" Private="False" />
|
||||
<Reference Include="UnityEngine.AudioModule" HintPath="..\Shared\Managed\UnityEngine.AudioModule.dll" Private="False" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user