Search Issue Tracker

Active

Votes

0

Found in

2017.4

2018.3.2f1

2018.4

2019.2

2019.3

2020.1

Issue ID

1198501

Regression

No

OnValidate fails to Undo the changes when one variable depends on another

Scripting

-

How to reproduce:
1. Open attached project "UndoValidateTest.zip" and scene "TestScene"
2. In Hierarchy window, select "GameObject" object
3. Navigate to Inspector window -> "Undo Validate Test" component
4. Increase "Bevel Radius" with a mouse(click and drag to increase) to around 0.5 (the value must be higher than 0 and lower than 1 for this particular repro)
5. Decrease "Primitive Size" x variable (click and drag to decrease) to 0
6. Clear the Console window (will be easier to see how many OnValidates were called)
7. Do Undo (Ctrl + Z)
8. Observe the "Bevel Radius" value in the Inspector window

Expected result: "Bevel Radius" value is undo'ed to around 0.5 (the value set in step 4)
Actual result: "Bevel Radius" is left as 0 due to one of the OnValidate "failing" to Undo the depending variable (due to Clamping)

Reproducible with: 2017.4.35f1, 2018.4.13f1, 2019.2.13f1, 2019.3.0b11, 2020.1.0a13

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.