Search Issue Tracker

Fixed

Fixed in 2022.3.62f1, 6000.0.47f1, 6000.1.0b15, 6000.2.0a4, 7000.0.0a19

Votes

16

Found in

2022.3.26f1

6000.0.0f1

6000.1.0a7

6000.2.0a1

7000.0.0a1

Issue ID

UUM-70574

Regression

No

TransformAccessArray.Add behaves differently when the argument is null and the argument is an int

-

Reproduction steps:
1. Open the attached “BugRepro” project
2. Open the “Assets/Scenes/SampleScene” Scene
3. Enter the Play Mode
4. Observe the arrays' length logged in the Console window

Expected result: The length of both arrays stay the same
Actual result: The length of array B is increasing, while the length of array A stays 0

Reproducible with: 2022.3.26f1, 2023.2.20f1, 6000.0.0f1
Couldn't test with: 2021.3.37f1 (TransformAccessArray.Add does not accept int as an argument)

Reproducible on: Windows 11
Not reproducible on: No other environment tested

  1. Resolution Note (fix version 6000.2.0a4):

    TransformAccessArray.Add APIs act consistently when passed null Transforms or invalid InstanceIds. They will add the null entry and print a warning to the console.

Comments (4)

  1. Enderlook

    Jun 30, 2025 12:28

    While the bugfix is greatly appreaciated, now the log are spammed with "Adding null Transform to TransformAccessArray will result in degraded performance.".
    While I understand that null transforms are kind of useless (wasting an index in a `IJobParallelForTransform`) they are useful to perform "patches" in collections that are send to jobs when some of the items are removed and transforms in the array access requires to mach index with other native collections content. Using null in those places prevent having to rewrite all collections to maintain this invariant.

  2. tessellation

    May 20, 2025 03:36

    Unfortunately this bug fix caused Unity's own 2D bone animation system to now log spam about "Adding null Transform to TransformAccessArray will result in degraded performance."

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.