We need to handle collisions between our enemies and ActiveBarriers. Since we have a Rigidbody attached to our Enemy prefab, it will receive the
OnTriggerEnter() event when it hits the collider of an ActiveBarrier GameObject.
Once the collisions with ActiveBarriers are implemented, we'll add collisions with the bottom of the screen, which will reduce the player's health.
In the Project view, select our ActiveBarrier prefab.
Disable its Box Collider component using its checkbox.
ActiveBarrierController.csscript attached to it.
We will need a new
builtboolean that will help us know if the barrier has finished its building process. Along with our
UILocalizevariables, declare the following:
private bool built = false;