Search Unity

The namespace global already contains a definition for_____

Discussion in 'Scripting' started by Jsmucker, Oct 23, 2014.

  1. Jsmucker

    Jsmucker

    Joined:
    Sep 5, 2014
    Posts:
    48
    I have a script that I copied and changed the name of it and I changed a specific line of code to play different animations depending on the character. So with this, the game gives the error "The namespace global already contains a definition for..." If I click on this, the line of code it has a problem with is below. How do I fix this?

    publicclassvp_DamageHandler : MonoBehaviour
     
  2. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,664
    If you change the name of the .cs file, it won't automatically update the name in the "public class" line. You have to do this manually. So, if you named the script (for example) vp_DamageHandlerModified, you'll also need to change the class name to this new name.