From 5f425171281f4bc998cba480aaec8134450608ef Mon Sep 17 00:00:00 2001 From: Forrest Trepte Date: Wed, 13 Jun 2018 15:05:07 -0700 Subject: [PATCH] fix issue #2300 by setting TargetObject.transform instead of this.transform --- .../Prototyping/Scripts/MoveToPosition.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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)