I have two Scrpits placed in my enemies, and one of them take a “isDead” boolean from the other to check is alive.
The thins is, when one of the enemies is died, the other take the boolean as true too.
Can i call a specific script? What can i do to solve it?
Thank you!
I would made it in one script becuase I find it much more simpler that way where you just can refer to the bool. What you could do is make the bool static by static public bool isDead = false
in the other script… Then you can access it in the other by
theotherscript.isdead;
It’s how I would done it if I use two scripts :]
Making it static would only work if there was a total of 1 enemy at any time, since the isDead variable would hold the same value for every single instance of the script.