Javascript error "Error Error: System.ArgumentException: An item with the same key has already been added. (Error: System.ArgumentException) (Assembly-UnityScript)"

function OnCollisionEnter(){

Debug.Log(“I’m Here!”);


Any idea why it’s spitting out an error? I’m new to this and I have no idea what I’m doing wrong. Any help will be appreciated!

I was following this tutorial:Unity 3D Student - 3d Modelling

It the error mentioning a custom script and a line number?

Other things to try:

  • Close Unity. Go to your project folder. Keep Assets and ProjectSettings. Delete everything else on that level (Library, sln. csproj files etc.). Reopen Unity to re-import everything and generate a new library.
  • Create a new project and make sure it runs. Then add the assets from your old project and manually type in or copy ProjectSettings. This approach saved me a couple of times when there was some generic error, I couldn’t track down.

Just some more info: I ran my old copy of Unity 4.6 used the backup files for project and everything worked fine.
There appears to be an error in unity 5.1 that caused this anommoly to appear.