http://pastebin.com/w3Zmweit : Health Bar script http://pastebin.com/rDHbiRzA: Health System script I was making an over head UI system, and ran across this error; 'Null Reference Exception: object reference not set to an instance of an object HealthSystem.Update () (at Assets/Scripts/Player/HealthSystem.cs:24)' Now, Everything is working but it spits out that error every frame, as far as I know the script should be working fine. The error accoutns for both line 24 & 25 --edit to clarify, both scripts are on the same object
It's not finding your HealthBar component. My best guess, from the information given, is that you have your HealthSystem script on something that doesn't also have a HealthBar component. Since you say everything is working, I'd check your scene to see if there's an object that has a HealthSystem component with no HealthBar component.