khangnhfuky / hotween

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

Wrong position tweening when using time at zero #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a tweening of position with a relative translation :
float time = 1;
gameObject.transform.position = new Vector ( 100, 100, 100 );
HOTween.To ( gameObject.transform, time,
    new TweenParms ()
    .Prop ( "localPosition", new Vector(100,0,0), true )
    .Delay ( delay )
    .Ease ( ease )
     );
2. With a time at zero, the position is wrongly computed.
3.

What is the expected output? What do you see instead?
Expected an immediate translation with position at 200,100,100.
Instead the position is 100,0,0.

What version of the product are you using? On what operating system?
HOTween v1.1.882

Please provide any additional information below.

Original issue reported on code.google.com by alexispa...@gmail.com on 29 Dec 2013 at 10:04

GoogleCodeExporter commented 9 years ago
I am confused about your values, since both the expected result and the actual 
position are wrong:
Expected result, at tween startup and time at zero, should be for the object's 
position to be at 100,100,100, and then to tween to 200,100,100 over a second 
(after the delay has elapsed).
Can you tell me if you were expecting something different, or else? I tried to 
replicate it, and everything behaves correctly here.

Original comment by daniele....@gmail.com on 30 Dec 2013 at 3:03

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Put that on a game object :

public class Foo : MonoBehaviour
{
    public float timeToTranslate = 0;

    void Start ()
    {
        transform.position = new Vector3 ( 100, 100 );
        HOTween.To ( transform, 0, new TweenParms ().Prop ( "localPosition", new Vector3 ( 100, 0, 0 ), true ) );
    }
}

After the tweening occurs, the position is 100,0,0. Was expected a position at 
200,100,0. Note that tweening is relative (third parameter of new TweenParms 
().Prop is true). Note that the duration is zero, which seems to make the bug 
occurs.

Regards

Original comment by alexispa...@gmail.com on 30 Dec 2013 at 7:13

GoogleCodeExporter commented 9 years ago
Oh now I understand. I tried to replicate it and indeed it's a bug, and a weird 
one. Working on it right now.

Original comment by daniele....@gmail.com on 3 Jan 2014 at 1:27

GoogleCodeExporter commented 9 years ago
Fixed it :) Can you check it out as an additional tester and let me know? You 
can get the latest DLL from the bin here on Google Code: 
https://code.google.com/p/hotween/source/browse/#svn%2Ftrunk%2FHoloville%2Fbin

Original comment by daniele....@gmail.com on 3 Jan 2014 at 3:47

GoogleCodeExporter commented 9 years ago

Original comment by daniele....@gmail.com on 5 Jan 2014 at 11:26