(1)
You wrote “names of the objects”. Did you mean "tags of the objects? The property gameObject.tag won’t return the “name”. The name is what is listed for that object in the Hierarchy window or at the top of the Inspector window for that object. That would be my first suggestion for what to check.
(2)
If that doesn’t help, check the tag text for any leading or following spaces and for upper/lower case. If you have "Friendly " or “friendly” it won’t match the case condition.
(3)
If that doesn’t solve it, then try adding a Debug.Log statement at the top inside of the OnCollisionEnter method that will print out the name and/or tag of every object that it collides into. I thought I was having a problem, so I added something like this:
Debug.Log("collided object name: " + other.gameObject.name + "; collided object tag: " + other.gameObject.tag);
This should at least tell you what objects your rocket is colliding with, and in what order it’s happening, BEFORE the code thread even reaches the switch statement.
(4)
If that doesn’t help, then my last suggestion is to cache the tag in a variable, and pass that variable to the switch statement. I.e.:
string collidedObjectTag = other.gameObject.tag;
switch (collidedObjectTag)
{
case ...
This shouldn’t make a difference, BUT sometimes it does and it leads me to discover something I hadn’t known before.
Good luck!