Zombie implement 1
This commit is contained in:
@@ -34,10 +34,6 @@ public class EnemyManager : MonoBehaviour
|
||||
}
|
||||
navMeshAgent.isStopped = true;
|
||||
navMeshAgent.enabled = false;
|
||||
gameObject.AddComponent<Rigidbody>();
|
||||
Rigidbody rigidBodyEnemy = gameObject.GetComponent<Rigidbody>() as Rigidbody;
|
||||
rigidBodyEnemy.velocity = -gameObject.transform.forward;
|
||||
rigidBodyEnemy.mass = 50;
|
||||
Destroy(this.gameObject, 3);
|
||||
}
|
||||
}
|
||||
@@ -73,7 +69,12 @@ public class EnemyManager : MonoBehaviour
|
||||
bodyParts[i].AddComponent<Rigidbody>();
|
||||
Rigidbody rigidBodyEnemy = bodyParts[i].GetComponent<Rigidbody>() as Rigidbody;
|
||||
bodyParts[i].AddComponent<MeshCollider>();
|
||||
rigidBodyEnemy.mass = 10;
|
||||
MeshCollider meshCollider = bodyParts[i].GetComponent<MeshCollider>() as MeshCollider;
|
||||
meshCollider.convex = true;
|
||||
if (i == bodyParts.Count -1) {
|
||||
rigidBodyEnemy.velocity = -bodyParts[i].transform.forward;
|
||||
}
|
||||
rigidBodyEnemy.mass = 10 * bodyParts.Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user