When performing a Shuffle
, Sort
operation on arrays, the value of the array does not change as a result.
Usage example:
-
Created a scene variable:
-
First, I display the current value, then I sort it, and display the result:
-
As a result, the value does not change:
If you use JavaScript
of the same function and change the event code like this:
Then the result will be correct:
I wrote an extension that an empty array should be passed to. It fills up and returns. As an example, I took the Array Tools
extension and found this problem that the value is not returned, the passed array does not change (in the extension this happens, but the value is not returned).
If you write the code in the extension like this:
Call:
First, the array will be empty. Secondly, if you look at what is displayed in the console, it turns out strange:
The array is empty when passed, and in the “Argument” line it is returned with filled values. A similar thing happens when it is executed through JavaScript
, but already in events (without extension). But the resulting array is not empty:
Result:
Test project: array_generator.json