Quantcast
Channel: Questions in topic: "javascripting"
Viewing all articles
Browse latest Browse all 105

nullreferenceexception object reference not set to an instance of an object

$
0
0
Please Help #pragma strict public var damage :int; function Start () { damage = damage; } function OnTriggerEnter(p : Collider){ if(p.tag == "Enemy") { GetComponent(EnemyHealth).HP -=damage; Debug.Log("The Enemy got " + damage + " damage"); } } this line is the problem but i don't know how to fix GetComponent(EnemyHealth).HP -=damage;

Viewing all articles
Browse latest Browse all 105

Trending Articles



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