luobin82Robin / dotween

Automatically exported from code.google.com/p/dotween
0 stars 0 forks source link

Error when using SpeedBased and [target value] = [current value] #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Run this code:

GameObject gameObj = new GameObject();
DOTween.To(() => gameObj.transform.position, x => gameObj.transform.position = 
x, new Vector3(0,0,0), 1).SetSpeedBased();

What is the expected output? What do you see instead?
An error:
transform.position assign attempt for 'New Game Object' is not valid. Input 
position is { NaN, NaN, NaN }.

What version of the product are you using? On what operating system?
DOTween 0.7.2.15

Please provide any additional information below.
It seems that when the target value is the same than the curren value and is 
SpeedBased this error appears

Original issue reported on code.google.com by fer...@gmail.com on 9 Aug 2014 at 4:30

GoogleCodeExporter commented 9 years ago
It seems that only vector has the problem

Original comment by fer...@gmail.com on 9 Aug 2014 at 4:35

GoogleCodeExporter commented 9 years ago
This code has the same problem:
new GameObject().transform.DOMove(new Vector3(0, 0, 0), 1).SetSpeedBased();

Original comment by fer...@gmail.com on 9 Aug 2014 at 4:40

GoogleCodeExporter commented 9 years ago
Thanks, managed to replicate it. It happened because the movement range was 
equivalent to 0 (I reckon you were trying to move an object which was already 
at 0,0,0 coordinates). Grab the latest update (0.7.225) for the fix: 
http://dotween.demigiant.com/download.php

Original comment by daniele....@gmail.com on 9 Aug 2014 at 7:40