I have script attached to New Level object so when I shoot it, it plays short music and loads next level.
I would like for the same script while in pause to allow music to finish playing and before loading new level to also disable all the turrets and player to shoot and move.
var turrets : GameObject[];
static var advance = false;
var player : Transform;
function Start ()
{
turrets = GameObject.FindGameObjectsWithTag("turret"); //<-- Find any gameObjects with tag "turret".
}
function OnTriggerEnter ( hit : Collider )
{
if(hit.gameObject.tag == "CannonBall")
{
Destroy(hit.gameObject);
}
if(hit.gameObject.tag == "Projectile")
{
advance = true;
for (var i = 0; i < turrets.Length; i++)
{
turrets*.active = false;*