Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

BCE0019: 'gameObject' is not a member of 'Object'.

$
0
0
Searched in sames question but didn't found my case... here's the code: var closeEnemies : Array = new Array(); //... for(var i : int = 0; i < closeEnemies.length + 1; i++) { if(closeEnemies[i] != null) { closeEnemies[i].gameObject.GetComponent(enemy).health -= damage; }else{ i++; } } //... function OnCollisionEnter2D (other : Collision2D) { if(other.gameObject.GetComponent(friendly).status == "Enemy" && ownCase.GetComponent(Case).empty == false) { y += 1; other.gameObject.GetComponent(numbers).x = y; closeEnemies[other.gameObject.GetComponent(numbers).x] = other.gameObject; } } function OnCollisionExit2D (other : Collision2D) { if(other.gameObject.GetComponent(friendly).status == "Enemy" && ownCase.GetComponent(Case).empty == false) { closeEnemies[other.gameObject.GetComponent(numbers).x] = null; } } As you can see closeEnemies is an Array wich I stock colliding gameObjects in. I tried a lot of things but I still get **BCE0019: 'gameObject' is not a member of 'Object'. ** error... What's wrong with the script ? Thx for your help.

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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