- Home /
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:http://www.unity3dstudent.com/2010/07/beginner-b01-basic-collision-detection/
Please post the entire script and include the line numbers of the error message. You might also be looking at the wrong script. Try double-clicking the error-message. It should take you right to the offending line. If it doesn't it's probably something in the Editor. If there is nothing apparent, you should try to narrow down the problem by removing everything part by part until the error disappears.
I have the same problem. Ive been away for a while (had a baby) and i got back to my project and it ran fine with no errors, so i made backup :) then updated to unity 5.1 today. Now monodevelope spits out this same "Error" i cant find any error. Think ill go back to unity 4.6 and use workarrounds to its drawbacks.
Answer by Xarbrough · Jun 20, 2015 at 05:46 PM
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.
Answer by JackSparrow1 · Jun 20, 2015 at 05:22 PM
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.
Your answer
