diff --git a/Assets/GameData/Action/Abilities/Vector Fence.asset b/Assets/GameData/Action/Abilities/Vector Fence.asset index a9a569d..05f8815 100644 --- a/Assets/GameData/Action/Abilities/Vector Fence.asset +++ b/Assets/GameData/Action/Abilities/Vector Fence.asset @@ -19,7 +19,7 @@ MonoBehaviour: abilityDuration: 5 abilityCooldownTime: 3 prefab: {fileID: 9694722736535169, guid: 9b94ed8895919e84aa669628b0761eaf, type: 3} - wallLength: 5 + wallLength: 7 wallWidth: 0.5 wallHeight: 1 scaleUpDuration: 1 diff --git a/Assets/Prefabs/Abilities/VectorFencePrefab.prefab b/Assets/Prefabs/Abilities/VectorFencePrefab.prefab index 6be1cff..bec365e 100644 --- a/Assets/Prefabs/Abilities/VectorFencePrefab.prefab +++ b/Assets/Prefabs/Abilities/VectorFencePrefab.prefab @@ -119,9 +119,9 @@ NavMeshObstacle: serializedVersion: 3 m_Shape: 1 m_Extents: {x: 0.5, y: 0.5, z: 0.5} - m_MoveThreshold: 0.1 + m_MoveThreshold: 0.01 m_Carve: 1 - m_CarveOnlyStationary: 1 + m_CarveOnlyStationary: 0 m_Center: {x: 0, y: 0, z: 0} m_TimeToStationary: 0.5 --- !u!114 &5807442085122568602 diff --git a/Assets/Scripts/Gameplay/VectorFencePrefab.cs b/Assets/Scripts/Gameplay/VectorFencePrefab.cs index bdc9ef8..0d4386a 100644 --- a/Assets/Scripts/Gameplay/VectorFencePrefab.cs +++ b/Assets/Scripts/Gameplay/VectorFencePrefab.cs @@ -31,6 +31,15 @@ public class VectorFencePrefab : NetworkBehaviour private IEnumerator ScaleUp() { + if (navMeshObstacle != null) + { + navMeshObstacle.enabled = true; + navMeshObstacle.carving = true; + navMeshObstacle.carveOnlyStationary = false; + navMeshObstacle.carvingMoveThreshold = 0.01f; + navMeshObstacle.center = Vector3.zero; // Adjust center if needed + navMeshObstacle.shape = NavMeshObstacleShape.Box; + } float elapsedTime = 0f; Vector3 originalScale = transform.localScale; Vector3 targetScale = new Vector3(Ability.wallLength, Ability.wallHeight, Ability.wallWidth); // Target full height scale @@ -44,14 +53,7 @@ public class VectorFencePrefab : NetworkBehaviour transform.localScale = targetScale; - // Enable the NavMeshObstacle after scaling is complete - if (navMeshObstacle != null) - { - navMeshObstacle.enabled = true; - navMeshObstacle.carving = true; - navMeshObstacle.center = Vector3.zero; // Adjust center if needed - navMeshObstacle.shape = NavMeshObstacleShape.Box; - } + } private IEnumerator DestroyAfterLifetime()