public Vector2 touchOffsets;
private Vector2 touchOffsetsScaled;
void OnEnable () {
touchOffsetsScaled = touchOffsets;
for ( int i=0; i<touchOffsets.Length; i++ ) {
touchOffsetsScaled <em>= new Vector2( touchOffsets<em>.x * touchScale.x, touchOffsets_.y * touchScale.y );_</em></em>
* }*
* }*
The Inspector shows touchOffsets values I’ve inputed correctly, once I turn on the script touchOffsets is modified by touchScale. It’s as if it’s directly linked to touchOffsetsScaled instead of being just a reference.
Nowhere else in the script uses touchOffsets, only touchOffsetsScaled. If I comment out the line in the loop neither Offsets or Scaled get modified as expected. This has me entirely stumped as it’s something simple, but unexpected.