I Cannot Figure out how to Fix This Specific Error

I am attempting to create a health & damage system, which consists of the player’s health, a damage function, and an enemy (not an actual enemy, just a ball that deals contact damage at the moment). I have encountered an error that states Screenshot from 2024-11-28 15-53-38, and I do not know how to fix it. I am an idiot, and cannot figure out how to fix it, mostly because I am 99% sure that I already put an object reference, so if anyone could assist me, I would be very grateful.
Photos of code will be shown below, because I can only add 1 image per post, because this account is new.

Player hp code:

enemy code:

In your first script in OnCollisionEnter it should be:

health.TakeDamage(damage);

BTW - In future you should post the code rather than a screenshot and then we can refer to the line numbers that need to be corrected or even post back the corrected code.

2 Likes