Trying to destroy enemy ship piece by piece

Hello! I was trying to destroy ship piece by piece, but a got an error: Assets/__Scripts/Enemy_4.cs(8,33): CS0030: Cannot convert type char' to string’
Thanks for your help!

GameObject goHit = coll.contacts [0].thisCollider.gameObject;
            Part prtHit = FindPart (goHit);
            if (prtHit == null) {
                goHit = coll.contacts [0].otherCollider.gameObject;
                prtHit = FindPart (goHit);
            }
            if (prtHit.protectedBy != null) {
                foreach (string s in prtHit.protectedBy) {
                    if (!Destroyed (s)) {
                        Destroy (other);
                        return;
                    }
                }
            }

At some point you are trying to assign a string variable a char value, or something along those lines. The error even points you to a specific line, which is usually correct. Sadly that’s just about everything i can tell you, because from that code sniplet i have no idea what the type of just about anything is, if this is even the correct script, or whether you edited the line mentioned in the error message to match the code sniplet or if that’s just coincidence and i should be looking somewhere entirely different.

When posting an error, include the full error message and all relevant code.

Some help to fix “Cannot implicitly convert type ‘Xxxxx’ into ‘Yyyy’:”

http://plbm.com/?p=263

Remember: NOBODY memorizes error codes. The error code is absolutely the least useful part of the error. It serves no purpose at all. Forget the error code. Put it out of your mind.

The complete error message contains everything you need to know to fix the error yourself.

Always start with the FIRST error in the list, as sometimes that error causes or compounds some or all of the subsequent errors.

The important parts of the error message are:

  • the description of the error itself (google this; you are NEVER the first one!)
  • the file it occurred in (critical!)
  • the line number and character position (the two numbers in parentheses)

All of that information is in the actual error message and you must pay attention to it. Learn how to identify it instantly so you don’t have to stop your progress and fiddle around with the forum.

How to understand compiler and other errors and even fix them yourself: