Fixed a few vector wall bugs

dev-hazim
Hazim Bin Ijaz 2 weeks ago
parent e2a3170fa6
commit a54ff1a6df

@ -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

@ -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

@ -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()

Loading…
Cancel
Save