- Home /
Unity - halo doesn't work all the time
Are there any known issues with using Halo in Unity. Creating a breakout style game in which I have a Halo around the paddle (turned off by default). When the paddle collides (through OnTriggerEnter2D) with a spawned object the Halo should turn on for 5 seconds and then turn off. But for some reason the Halo turns on with first collision but then for the next two collision it doesn’t (it still makes the collision) and then it turns on ok for the next (4th) collision.
if (other.gameObject.tag == “halo”) {
Paddle.halo.enabled = true;
}
This turns on the halo
float timeLeft = 5f;
void Update () {
timeLeft -= Time.deltaTime;
if (timeLeft < 0f) {
Paddle.halo.enabled = false;
timeLeft = 5f;
}
}
This is the countdown timer to turn the halo of after 5 seconds. The problem is the halo doesn't always turn on even though it is making the collision.
Your answer
Follow this Question
Related Questions
Cant acces an image icon from class 0 Answers
Prevent picking up multiple items at same time 1 Answer
Code in void not executing 0 Answers
triplex 2d unity game 0 Answers
why Lagging from tilemap 0 Answers