truyet / hotween

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

A bug about HOTween Reverse #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Add a normal hotween 
HOTween.From( target1, 3, new TweenParms().Prop( "position", new 
Vector3(10,0,0)).Delay(2).Ease( EaseType.Linear ).Reverse()
2. The bug happen
3. Frist Bug Is nothing move when I use Reverse()
4. Second Bug Is "Delay" is not work too when I use Reverse()

What is the expected output? What do you see instead?

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

HOTween v1.3.380 
Windows8 
Unity3d 4.5.5f1

Please provide any additional information below.
I check the source code about this bug.
Maybe the bug is here

Tweener.cs 
line 804

                if (_isReversed)
                {
                    _fullElapsed = _elapsed = 0;
                }

Original issue reported on code.google.com by tuna.ji...@gmail.com on 3 Dec 2014 at 10:28

GoogleCodeExporter commented 9 years ago
Hi,

I'm not sure what you're considering a bug. If you create a tween and set it to 
reverse it will play backwards, and considering in your example it has just 
been created and thus the time is 0, nothing will happen and the tween will 
correctly not play.
Maybe you're confused about how From works. In your case it sets your transform 
to animate from 10,0,0 to the position it had when you created the tween, but 
the tween will still move forward and not backwards.

Original comment by daniele....@gmail.com on 5 Dec 2014 at 11:22

GoogleCodeExporter commented 9 years ago
Hi, 
  Sorry I should tell more information for that.

  The bug mean is I create a Tweener(From or To does not matter), When I call PlayBackwards(call Reverse() in the begin is same thing), 
Then tween should begin runing. but now nothing run.  

Like the example 

I want use 3 second let the target move from 10,0,0  (the target is Transform, 
and position is 0,0,0 )   

HOTween.From( target, 3, new TweenParms().Prop( "position", new 
Vector3(10,0,0)).Ease( EaseType.Linear )   The results ...(9, 0, 0) ....(8, 0, 
0)....(7, 0, 0)...(0, 0, 0)  kind of that 

When I call PlayForward() is working fine . that is what I need. But When I 
call PlayBackwards..

tw = HOTween.From( target, 3, new TweenParms().Prop( "position", new 
Vector3(10,0,0)).Ease( EaseType.Linear ) 

tw.PlayBackwards ();   The results should be  ...(0, 0, 0) ....(1, 0, 0)....(2, 
0, 0)...(10, 0, 0)  

I think is the tween is should be use 3 second move to 10,0,0 

Yes you can tell me just use the HOTween.TO,  I know that, But why the 
PlayBackwards () is should be working fine Right?  So I send a bug for that 

Original comment by tuna.ji...@gmail.com on 6 Dec 2014 at 5:41

GoogleCodeExporter commented 9 years ago
Hi The same bug is still happen in http://hotween.demigiant.com/testRun.html
Basic Hotween Test

What steps will reproduce the problem?

1.click Reverse
2.click Play Button
3.the bug happen.

or

1.click Reverse
2.click Restart button
3.the bug happen.

or 

1.click Play button
2.click Reverse
3.the bug happen the tween never finish

Original comment by tuna.ji...@gmail.com on 6 Dec 2014 at 6:36

GoogleCodeExporter commented 9 years ago
Hi and sorry for the late reply: I was doing the last Ludum Dare and going 
crazy with it :P

Unless I understood your explanation wrongly, I still think you misunderstand 
how PlayBackwards work. PlayBackwards (or Reverse), plays the tween backwards 
from its current position. So if you call it before the tween has played 
forwards for some time, nothing will happen because the position is already 
rewinded.

If you want to fully play a PlayBackwards from the end of the tween (thus 
playing the full tween in reverse) you should:
a) create the tween and set its AutoKill to false (so it won't be killed when 
completed)
b) call myTween.Complete() to send it to its end position
c) call PlayBackwards()

Original comment by daniele....@gmail.com on 9 Dec 2014 at 1:01

GoogleCodeExporter commented 9 years ago
Thanks for you replay,

I try to use your way to do that. But the shit box is still not move any more. 
(the box is Transform for sure)
I use a lot of hotween in my game. is all working fine with out use 
PlayBackwards (or Reverse)

Tweener myTween = HOTween.From( box, 3, new TweenParms().Prop( "position", new 
Vector3(10,0,0)).AutoKill(false));
myTween.Complete ();
myTween.PlayBackwards ();

I real do not know what wrong in my code.

Original comment by tuna.ji...@gmail.com on 10 Dec 2014 at 7:23

GoogleCodeExporter commented 9 years ago
I just tried to replicate your code and everything works perfectly here. Can 
you create a barebone project and attach it here, so I can check what's wrong?

Original comment by daniele....@gmail.com on 11 Dec 2014 at 7:36

GoogleCodeExporter commented 9 years ago
Hi and sorry for the late reply.

My fault. I forgot to press ctrl + s ( not save the code, shit happen.   )  

Thanks to tell me the right way to use Reverse .

this week for me is going to crazy working on overtime everyday .

Sorry for waste your time.

Thanks a lot 

Original comment by tuna.ji...@gmail.com on 22 Dec 2014 at 10:20

GoogleCodeExporter commented 9 years ago
Glad you solved it :)

Original comment by daniele....@gmail.com on 22 Dec 2014 at 10:34