No, the question is whether you can elaborate. The error message in Unity tells you not just the text of the error, but also what file, and which line of that file, it occurs on.
But you haven’t told us that. You’ve given us only the text of the error message, not which file or line number it is on. So you’re asking us to read through all your code and find where it might be.
When an error comes up, it tells you the file name and line with the error (usually looks like this FileName:LineNumber).
Anyways, the error is here:
EnemyHealth -= 20; //Bullet strength is 20
You’re trying to mathematically manipulate the name of a class, which doesn’t make a whole lot of sense. You probably want to do something more like this:
So first we use GetComponent() to get the EnemyHealth component from the colliding GameObject, then check if it’s valid (to make sure the GameObject actually has an EnemyHealth component) and call the TakeDamage method appropriately.
Where you change it depends on your original intentions. Did you intend for TakeDamage to require a Vector3? If not, remove it from the definition and it’ll work. If you did, you need to supply the appropriate Vector3 to the method call in the damage script.
Changing line 17 to publicvoid TakeDamage (int amount) would work as you are not using the Vector3 anyway, unless you are planning on adding more code that requires it,