diff --git a/Assets/HoloToolkit-Examples/Prototyping/Scripts/MoveToPosition.cs b/Assets/HoloToolkit-Examples/Prototyping/Scripts/MoveToPosition.cs index 234f10be7da..975da7c9c8d 100644 --- a/Assets/HoloToolkit-Examples/Prototyping/Scripts/MoveToPosition.cs +++ b/Assets/HoloToolkit-Examples/Prototyping/Scripts/MoveToPosition.cs @@ -92,11 +92,11 @@ public void ResetTransform() { if (ToLocalTransform) { - this.transform.localPosition = mStartValue; + TargetObject.transform.localPosition = mStartValue; } else { - this.transform.position = mStartValue; + TargetObject.transform.position = mStartValue; } IsRunning = false; mLerpTimeCounter = 0; @@ -195,11 +195,11 @@ private void Update() if (ToLocalTransform) { - this.transform.localPosition = GetNewPosition(this.transform.localPosition, percent); + TargetObject.transform.localPosition = GetNewPosition(TargetObject.transform.localPosition, percent); } else { - this.transform.position = GetNewPosition(this.transform.position, percent); + TargetObject.transform.position = GetNewPosition(TargetObject.transform.position, percent); } if (percent >= 1) @@ -213,13 +213,13 @@ private void Update() bool wasRunning = IsRunning; if (ToLocalTransform) { - this.transform.localPosition = GetNewPosition(this.transform.localPosition, LerpTime * Time.deltaTime); - IsRunning = this.transform.localPosition != TargetValue; + TargetObject.transform.localPosition = GetNewPosition(TargetObject.transform.localPosition, LerpTime * Time.deltaTime); + IsRunning = TargetObject.transform.localPosition != TargetValue; } else { - this.transform.position = GetNewPosition(this.transform.position, LerpTime * Time.deltaTime); - IsRunning = this.transform.localPosition != TargetValue; + TargetObject.transform.position = GetNewPosition(TargetObject.transform.position, LerpTime * Time.deltaTime); + IsRunning = TargetObject.transform.localPosition != TargetValue; } if (IsRunning != wasRunning && !IsRunning)