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

Script Error (EnemyHeal): Update() can not take parameters.

$
0
0
Here is a script #pragma strict var enemyHeal : int = -5; var item : Transform; var enemy : Transform; function Update(col : Collider) { if(col.gameObject.tag == "Bullet") { enemyHeal -= 30; } if(enemyHeal <= 0) { var position : Vector3 = Vector3(Random.Range(-10.0, 10.0), 0, Random.Range(-10.0, 10.0)); Instantiate(item, enemy.transform.position + Vector3(0,20,0) + position, Quaternion.identity); Destroy(this.gameObject, 2); } } When "Bullet" hits "Enemy" i got this error "Script Error (EnemyHeal): Update() can not take parameters."

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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