Search Issue Tracker

By Design

By Design in 6000.5.X

Votes

0

Found in

6000.0.58f1

6000.2.6f1

6000.3.0b4

6000.4.0a1

6000.5.0a1

Issue ID

UUM-120713

Regression

No

Duplicated items across all SerializedProperties when inserting a new element

Serialization

-

Reproduction steps:
1. Open the attached project "ReproProj"
2. Open the “/Assets/Scenes/SampleScene.unity” Scene
3. Select the “Tester” GameObject on the Hierarchy
4. Look at the Inspector to perform the next steps
5. Click the Button with the text “Initialize” to prepare the test
6. Click the Button with the text “Insert Node At Last And Make Connections” to add the 1st node
7. Expand every foldout element in the Inspector
8. See that “Node Id 1” has 1 connection
9. Click the Button with the text “Insert Node At Last And Make Connections” to add the 2nd node

Expected result: Node ID 1 should have 2 connections, while Node ID 2 should have only 1 connection
Actual result: Both nodes have 2 connections

Reproducible with: 6000.0.58f1, 6000.2.6f1, 6000.3.0b4, 6000.4.0a1

Testing environment: Windows 10 Enterprise 21H2
Not reproducible on: No other environment tested

  1. Resolution Note:

    Thank you for reporting a bug to Unity.

    After reviewing the behavior, we've confirmed it aligns with the current design and intended use of the feature. We understand this may differ from your expectations or workflow.

    We will close this case as 'As Designed.' If you have feedback on how the feature could better meet your needs, please let us know - we value your input and consider it in future improvements.

    When a element is inserted into an array "The value of the inserted element is undefined and should be explicitly set after calling this function." from the documentation at https://docs.unity3d.com/ScriptReference/SerializedProperty.InsertArrayElementAtIndex.html

    With that in place we would recommend calling .ClearArray(); on the SerializedProperty when you are expecting it to be clear.

  2. Resolution Note (6000.5.X):

    Thank you for reporting a bug to Unity.

    After reviewing the behavior, we've confirmed it aligns with the current design and intended use of the feature. We understand this may differ from your expectations or workflow.

    We will close this case as 'As Designed.' If you have feedback on how the feature could better meet your needs, please let us know - we value your input and consider it in future improvements.

    When a element is inserted into an array "The value of the inserted element is undefined and should be explicitly set after calling this function." from the documentation at https://docs.unity3d.com/ScriptReference/SerializedProperty.InsertArrayElementAtIndex.html

    With that in place we would recommend calling .ClearArray(); on the SerializedProperty when you are expecting it to be clear.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.