- Home /
My project kicks me every time I destroy a block
Every time I press play and I shoot at something until the object is destroyed, the game tab freezes and I get kicked out of fullscreen mode. When I press play again, it stops and acts like nothing happens. I test out the guns by shooting a cube until it gets destroyed, but this only happens if I destroy an object so I need help.
Could you maybe share some code, how you are destroying the object? Would help to find the problem maybe.
Here:
using UnityEngine;
public class Target : $$anonymous$$onoBehaviour { public float health = 100f;
public void TakeDamage (float amount)
{
health -= amount;
if (health <= 0f) {
Die();
}
}
void Die ()
{
Destroy(gameObject);
}
}
The problem started when I was trying to add a $$anonymous$$i-map. I was using a brackeys tutorial on how to do it too. @BBIT-SOLUTIONS
I figured it out. I left error pause on so if anything the game thought wasn't supposed to happen would pause it for me. Thanks anyways
oh ok, i guess that would have been hard to find out for us remotely^^
Nice that you fixed it, and thanks for the update.
Your answer
![](https://koobas.hobune.stream/wayback/20220612230745im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Object not being destroyed when shot 0 Answers
My ship destroyed when i press fire 1 Answer
getting udp package info inside unity (GlovePIE) 0 Answers
Zero gravity race game issue 1 Answer
Character Rigging 1 Answer