Quantcast
Channel: Answers for "Accessing variables from GameObjects in an array"
Browsing all 6 articles
Browse latest View live

Answer by TMM

enemyName is not a member of a component. Its just only name. So try:enemyName = enemy.GetComponent(enemyHUD).name;And for your game performance its better to use FindGameObjectsWithTag once in the...

View Article


Answer by Tetrad

If Unity itself is crashing (i.e. not the game not working), make sure your property isn't causing an infinite loop.This will cause unity to break:string enemyName { get { return enemyName; } //...

View Article


Answer by skovacs1

General problems that could be omissionsYou never close your OnGUI.You may have just omitted from your included code, but there are two immediate problems that I see with this script:1 What are...

View Article

Answer by TMM

enemyName is not a member of a component. Its just only name. So try:enemyName = enemy.GetComponent(enemyHUD).name;And for your game performance its better to use FindGameObjectsWithTag once in the...

View Article

Answer by Tetrad

If Unity itself is crashing (i.e. not the game not working), make sure your property isn't causing an infinite loop.This will cause unity to break:string enemyName { get { return enemyName; } //...

View Article


Answer by skovacs1

General problems that could be omissionsYou never close your OnGUI.You may have just omitted from your included code, but there are two immediate problems that I see with this script:1 What are...

View Article
Browsing all 6 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>