I seem to have a RaycastHit problem?

In the future please use code tags as described here to make the code in your post more readable: Using code tags properly

As far as your code - from what I’m seeing here it looks fine to me. Can you explain what makes you think it’s not working? have you tried adding Debug.Log statements in your code at strategic places to see which code is running and when? Maybe log which object you hit and how much damage you’re subtracting from their health, and their health before and after doing that.