I’m working on my medical state, and on the medicalstate class I have used the UnityEngine library while inheritance the MonoBehaviour.
I have this code (this is not the start, update script, that’s a diffrent class):
if (ExeptedBloodAfterHit >= 2000.0)
{
this.BloodRightNow = ExeptedBloodAfterHit;
}
else
{
this.BloodRightNow = 2000.0;
/* Disable controller. */
/*# Move to unconscious mode.
to do: Set timer that every tick you lose some blood untill you die, the timer will stop after you'll be rescued.
*/
InvokeRepeating("UncoiniusDammageControl", 1f, 1f);
UncoiniusMode();
}
}
(part of the script),
and there is a method before that this line was called I got this method:
public void UncoiniusDammageControl()
{
this.BloodRightNow -= 3.3;
if (this.BloodRightNow <= 0)
{
//Change to the dead menu.
CancelInvoke("UncoiniusDammageControl");
}
}
And I have checked 3 times and the name that’s beiing invoked iis the same.
Why does it giving me a NullRefernceException on that line:
InvokeRepeating("UncoiniusDammageControl", 1f, 1f);