Script default value instances are reused, causing unexpected behavior #423
Labels
bug/confirmed
Bug/regression has been confirmed.
cherrypick:2.0
Requires cherry-pick to Orchestrator 2.0
kind/bug
A bug or regression in expected behavior.
Milestone
Describe the bug
Given the following nodes:
When the
arr
input pin is connected with aMake Array
node, each call to the node will use a newArray
instance. For this use case that was the desired outcome. However, if aMake Array
node was not connected, this node used anArray
instance from the default value cache, which was re-used on each call. This re-use in this context causes the array to continuously grow due to the function's logic appending elements to this array on each call.This raises the question, should default values always create a new instance.
Expected behavior
The user behavior should be the same regardless of whether a
Make Array
node is or is not connected.Actual behavior
The same
Array
instance is re-used when thearr
pin has no connection.How to Reproduce?
No response
Godot full version
N/A
Orchestrator version
2.0.1.stable
Additional information
No response
The text was updated successfully, but these errors were encountered: