Im only getting a single error and the code is all in, the error is, The type or namespace name ‘PlayerHealth’ could not be found are you missing a using directive or an assembly reference?
Here is a picture of the code Imgur: The magic of the Internet
change
= (PlayerHealth)target.GetComponent("PlayerHealth");
to
= target.GetComponent("PlayerHealth");
See if that helps
I changed and saved the code to yours and I am still getting the same error.
it should be:
target.GetComponent<PlayerHealth>();
Tried, still.