A little help with my 2d shooter

So recently, I made a 2d shooter. I’m having a little trouble with the bullets though. When you shoot the AI bot and take away all of its health, it does nothing. I don’t know any scripts that will make it disappear. Help?

File: https://drive.google.com/file/d/1MzLE2dnzYCA0fw9K2sV8z48PLqQ1BhgD/view?usp=sharing

if([health name variable]===0){
this.remove()
}

place this in the update script of the enemy clip
get rid of the square brackets and replace it

Doesn’t work, maybe I’m not doing it right. Could you send more instructions?

I tried putting it in and it just threw an error…

did the same thing with me.

It said error on line 58266 which means it’s undefined or null or something along those lines.

same error it gave me, also thanks for that, I didn’t know that.

so no solution?

make sure the variable is called correctly. if it’s created like this.myVar = 0 (for example), make sure to refer to it as this.myVar, not just myVar. the “this” is important.