However the problem is that OnHit does not work with weapons unfortunately, so the OnHit script would have to be attached to the player character instead and not the weapon itself.
So what we want to do here is make it so that when the player is hit a variable/property in the weapon script is changed but only because another script attached to the PC says to do so (only when hit). I also know that when the PC is hit by a specific weapon the OnHit event can be called on that basis alone but this script is for a weapon that the PC is wielding and not any enemy.


.

