- Home /
Question by
bigmike777 · Jul 26, 2020 at 10:16 AM ·
c#3dfps
how to make it so that when I get all targets with target code a win screen pops up
I want a you win screen to pop up when I get all 21 targets with the target code. this is target code.
using UnityEngine;
public class Target : MonoBehaviour { public float health = 100f; public void TakeDamage (float amount) { health -= amount; if (health <= 0f) { Hurt(); } }
void Hurt ()
{
Destroy(gameObject);
}
function Update()
{
var target : GameObject[] = GameObject.FindGameObjectsWithTag("Enemy");
if (target.Length <= 0)
Application.LoadLevel("WinScreen")
}
Comment
Your answer
Follow this Question
Related Questions
Gun not smoothly following player,How to make gun smoothly follow player 1 Answer
how do i make a ammo and reload system 1 Answer
Gun not smoothly following player,How to make gun smoothly follow player 0 Answers
how to make it so that when I get all the targets with the target code a win screen pops up 1 Answer
Trace 3D Basketball Shot 1 Answer