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

Answer by TMM

$
0
0

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 start function.


Viewing all articles
Browse latest Browse all 6

Trending Articles



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