Closed ChallengeTr closed 1 year ago
I'm sorry, I think I have found the reason for the error. When copying the new user's default data, it was not duplicated with duplicate(deep=true), so the Array in the Dictionary was only a copied reference. And the default data is const. So when assigning a value to the Array, an error occurred. I was so noob..
Godot version
4.0.2 stable
System information
Windows10 22H2
Issue description
Strange issue, I'm trying to replace an element in an Array with a Dictionary data. However, the Debugger always interrupts the program. But there are indeed 48 elements in this Array. Moreover, when running the exported program, there is no error message in the log and it runs as expected. Additionally, there is very little information in the debugger.
”players_data" is user data read from a JSON file
The program is interrupted after entering this method:
This is print result:
This is debugger info.: I swear the array has enough elements, In editor progarm interrupt. When running exported no error log and runs as expected. Invalid set index '2' (on base: 'Array') with value of type 'Dictionary'
Steps to reproduce
skip
Minimal reproduction project
I tested similar operations in a simplified way in other parts of the same project, and did not encounter similar errors: