What does this do? value1 = value2 = 0

Came across this statement in a 3rd party asset script. To confirm, it’s as above (not value1 = value2 == 0). Is it assigning a value of 0 to both value1 and value2?

Appreciate any help!

Is it assigning a value of 0 to both
value1 and value2?

Yes, it is. This is the usual C style assignment logic. The important take away is that an assignment operation itself as an expression results in the right side of the assignment. It’s all very well explained in the C# documentation. It even has the example of a = b = c and even explains that the assignment operator is right associative. So the expression is actually evaluated like this a = (b = c)

Never seen this before but “==” is an equality operator used in conditions, so that line is not a value assignment but rather a Boolean, assuming it even works that is.