Files
godot-website/collections/_release_4_5/entry-general-core-duplicate-at-ease-with-expected-results.md
Adam Scott 5387797774 Godot 4.5 release page
Huge thanks to JohnVeness, AThousandShips, and Meorge for their
great help rewording my broken English.
2025-09-15 16:03:40 -04:00

2.2 KiB
Raw Permalink Blame History

type, section, subsection, rank, importance, anchor, title, blockquote, text, contributors, read_more
type section subsection rank importance anchor title blockquote text contributors read_more
entry general core 2 3 duplicate-at-ease-with-expected-results Duplicate at ease with expected results As deep as you wish For a long time, even though [``@[Resource](enginetype)@[.](symbol)@[duplicate](membervariable)@[()](symbol)``](https://docs.godotengine.org/en/4.5/classes/class_resource.html#class-resource-method-duplicate) has a ``@[deep](membervariable)`` parameter, people realized that setting it to ``@[true](basetype)`` doesnt always perform in a reliable and predictable way. [Notably](https://github.com/godotengine/godot/issues/74918), it does not duplicate subresources stored inside ``@[Array](basetype)`` or ``@[Dictionary](basetype)`` properties. The same thing happens with [``@[Array](basetype)@[.](symbol)@[duplicate](membervariable)@[()](symbol)``](https://docs.godotengine.org/en/4.5/classes/class_array.html#class-array-method-duplicate) and [``@[Dictionary](basetype)@[.](symbol)@[duplicate](membervariable)@[()](symbol)``](https://docs.godotengine.org/en/4.5/classes/class_dictionary.html#class-dictionary-method-duplicate). The new ``@[duplicate_deep](function)@[()](symbol)`` methods for these classes now give users full control over what gets duplicated or not. This new feature is the result of an overhaul of the duplication logic for arrays, dictionaries, and resources. For developers, we made sure to keep what was working and consistent intact. If you need more details, feel free to consult our new exhaustive documentation about the duplication specification.[^duplicate-at-ease-with-expected-results] [^duplicate-at-ease-with-expected-results]: See the [``@[Array](basetype)``](https://docs.godotengine.org/en/4.5/classes/class_array.html#class-array-method-duplicate), [``@[Dictionary](basetype)``](https://docs.godotengine.org/en/4.5/classes/class_dictionary.html#class-dictionary-method-duplicate), and [``@[Resource](enginetype)``](https://docs.godotengine.org/en/4.5/classes/class_resource.html#class-resource-method-duplicate) API documentation.
name github
Pedro J. Estébanez RandomShaper
https://github.com/godotengine/godot/pull/100673