Search Issue Tracker

Duplicate

Votes

0

Found in

2021.3.44f1

2022.3.50f1

6000.0.23f1

Issue ID

UUM-84103

Regression

No

Components of a Prefab instance lose their values that are updated with the Reset() method when entering Play Mode

--

-

How to reproduce:
1. Create and open a new project
2. Create an Empty GameObject
3. Attach “ComponentA.cs” and “ComponentB.cs” scripts to the GameObject
4. Delete all strings and uncheck checkboxes in both Components of the Empty GameObject in the Hierarchy
5. Drag the GameObject to the Project tab (to create a prefab of the GameObject)
6. Select the Empty GameObject in the Hierarchy
7. Click the “Reset“ button in the Context menu of the ComponentA in the Inspector
8. Enter Play Mode
9. Observe the Inspector

Expected results: Both Components retain their values before entering Play Mode
Actual results: ComponentB forgets its values and sets its values to what they were before resetting them in the Inspector and ComponentA retains its values they were after resetting them

Reproducible in: 2021.3.44f1, 2022.3.50f1, 6000.0.23f1

Reproduced on: Windows 11 Pro (23H2)
Not reproduced on: No other environment tested

Notes:
- When the ComponentA is reset, it sets all checkboxes to true and the string fields to “I’m set to true“ of both Components
- If, for example, a checkbox is not unchecked in ComponentB before resetting ComponentA, after entering Play Mode it will still be set to true
- This does not work with non-prefabed GameObjects
- It’s likely, that the fields are reset only visually, as the labels of the ComponentB fields do not become bolded (indicating unsaved changes)

  1. This is a duplicate of issue #UUM-84286

    Prefab's component value gets reset when entering Play Mode
  1. Resolution Note:

    We are closing this issue as a duplicate. Please read resolution notes for the original bug as they apply to this case as well.
    Duplicate of https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-84286

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.