Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Script duplicates after I edit it. Bug? Or did I do something...

Discussion in 'Editor & General Support' started by MiTsSsS4, Jun 21, 2020.

  1. MiTsSsS4

    MiTsSsS4

    Joined:
    Apr 17, 2020
    Posts:
    2
    Hey guys,

    Here's a weird one, each time I edit a script (in VisualStudio), I come back to the editor only to find compiler errors that the Update() and FixedUpdate() are used in the same script several times (Error CS0111). I don't think this is something that can't be fixed simply by restarting the editor or starting a new project, but I thought it was too weird to not post on here and hopefully help other people who are not able to restart their projects from scratch because they made a lot of progress in it.
     
    Last edited: Jun 23, 2020
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,203
    Can you post the actual error, and ideally use Code tags to post the code it's complaining about?
     
  3. MiTsSsS4

    MiTsSsS4

    Joined:
    Apr 17, 2020
    Posts:
    2
    Hello and sorry for the late reply,

    the only errors that were being generated in the editor console were the ones I mentioned in the original post, the editor was complaining about the existence of more than 1 Update() and FixedUpdate() in the same script, (because it was duplicating it whenever I change something in it inside VisualStudio and come back into Unity) it was Error CS0111 I believe. Also, as I said before, nothing a simple restart couldn't fix, but I thought I'd post about it so people won't panic if it ever happens with them.
     
    Last edited: Jun 23, 2020