Closed ksmithdev closed 4 months ago
This block of code does seem to be the culprit: https://github.com/bitbrain/beehave/blob/godot-4.x/addons/beehave/nodes/composites/randomized_composite.gd#L127-L129
When navigating away from the scene, it removes the weight information from each child as it's treated like the child was deleted. Navigating back restores the children but the weights are all reset to 1.
Resolved with PR #329
Godot version: v4.2.1.stable.mono.official [b09f793f5]
Describe the bug The weights for SelectorRandomComposite (and I assume SequencerRandomComposite) get reset to 1 after switching away and back to the node.
To Reproduce Steps to reproduce the behavior:
Expected behavior Setting weights in a RandomizedComposite should never reset unless changing the number of nodes.
Screenshots
![image](https://github.com/bitbrain/beehave/assets/3381769/2b48d972-ee58-4e7f-b99f-ce90b955c3fc)
Desktop (please complete the following information):
Additional context The issue might be in the RandomizedComposite root node when _on_child_exiting_tree is called. The child looks like it's being removed and the weights are being reset? https://github.com/bitbrain/beehave/blob/godot-4.x/addons/beehave/nodes/composites/randomized_composite.gd#L127-L129