Quantcast
Channel: Questions in topic: "exception"
Viewing all articles
Browse latest Browse all 470

Object reference not set to an instance of an object when it actually is?

$
0
0
So I'm getting the error. NullReferenceException: Object reference not set to an instance of an object Which I know means it's not assigned correctly. The problem is, it looks like it's all set up properly. I can't figure out where I'm going wrong so i'll run through the logic. I have a projectile that fires (from the player) that has a script on it that if it hits it calls a PlayerPassiveAbility() method on the player that will call enemyHealth.TakeDamage(damage); When it hits and calls that enemyHealth.TakeDamage(damage); though, that's where I get the error. Both scripts have public EnemyHealth enemyHealth; on them and they're both set so I'm not sure why i'm getting this error.

Viewing all articles
Browse latest Browse all 470

Trending Articles



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