theodor349 / 4P-Chess

Unity Project: 4 Pplayer chess
0 stars 2 forks source link

Not Run any unity3d editor version #2

Closed PAYALzariya closed 3 years ago

PAYALzariya commented 4 years ago

I was check your project. it is not run in any unity3d 2019 editor it is showing error is KeyNotFoundException: The given key was not present in the dictionary. System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <599589bf4ce248909b8a14cbe4a2034e>:0). in CharacterController.cs scripts in GetSprite() function is return sprite. But you are passing only sprite, not name for using dictionary.

theodor349 commented 4 years ago

Hi, I have just uploaded a fix. And I know it works with Unity 2019.2.0b9 but newer versions should work.

But if you try to debug it you will find that at line 88 in the CharacterController script it tries to find a sprite in the dictionary "characterSprites". The key it looks for is in all caps, whereas all the keys in the dictionary only the first character is in caps. This can be solved by renaming all the sprites under "/resources/sprites/characters" with all caps characters.