↧
Answer by PeterDC
Instead of using public use static; that should keep your variable the same value in all instances of the script.
View ArticleAnswer by Marowi
You're on the right track.You should probably do it less often than in every Update(), but FindGameObjectsWithTag will work. You then need to get the component (script) that the variable is in, using...
View Article