- Home /
Duplicate Question
Need help with setting all items of a specific tag to "inactive" when i die.
I am making a platform level and my death trigger looks like this. the level is based around hitting switches to activate the next platform. but when i die, i want the platforms to go back to how they were when the level started, inactive.
var spawn : Transform; var platforms : GameObject[];
platforms = GameObject.FindGameObjectsWithTag("platforms");
function OnTriggerEnter(other : Collider) { if (other.tag == "Player") {
other.transform.position = spawn.position;
audio.Play();
platforms.SetActive(false);
}
}
I want the game objects with the tag "platforms" to be set to inactive when i cross the death trigger, effectively starting the level over.
but right now, nothing is happening, im respawning, but the platforms are still active.
Follow this Question
Related Questions
Need help with setting all items of a specific tag to "inactive" when i die. 1 Answer
My array does not update when object is destroyed. How do I fix it? (java) 2 Answers
Enable Disable Components attached to tagged Game Objects 1 Answer
Find colliders after collision? 2 Answers
Problem removing items from array 2 Answers