-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArgumentOutOfRangeException: Index was out of range #2
Comments
This error can be fix by adding material on fox and rabit prefab |
lastElementIndex is -1 when map[regionX, regionY].Count is 0 |
@SebLague, do you accept pull requests? |
Hello it's because there an error with material assignation, I don't know so much unity but object oriented programming and it seem that the material variable of plants, foxes or bunnies is inherited from the LivingEntity Class.
when meshRenderer.sharedMaterials[i] == material, material value is... none. I don't know what was the idea behind this. (still noob on unity framework) |
OK found, the camera is just not set correctly and there seem to have no control on it implemented into the simulation but you just need to set it with these values : |
@CyberDuck79 i tried that its still not working (the material stuff) |
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at :0)
System.ThrowHelper.ThrowArgumentOutOfRangeException () (at :0)
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at :0)
Map.Remove (LivingEntity e, Coord coord) (at Assets/Scripts/Environment/Map.cs:138)
Map.Move (LivingEntity e, Coord fromCoord, Coord toCoord) (at Assets/Scripts/Environment/Map.cs:148)
Environment.RegisterMove (LivingEntity entity, Coord from, Coord to) (at Assets/Scripts/Environment/Environment.cs:63)
Animal.AnimateMove () (at Assets/Scripts/Behaviour/Animal.cs:221)
Animal.Update () (at Assets/Scripts/Behaviour/Animal.cs:76)
The text was updated successfully, but these errors were encountered: