Search Unity

DOTween (HOTween v2), a Unity tween engine

Discussion in 'Assets and Asset Store' started by Izitmee, Aug 5, 2014.

  1. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,228
    @fermmmm Hi! I tried to replicate your code with my debug setup, where I can lower the FPS on command. I ran it at 2 FPS and OnComplete was called correctly. Instead, I found a bug where speed-based tweens weren't evalued correctly at startup (at low FPS). The update I'm attaching fixes this. Can you check if it fixes also your OnComplete issue?

    @Devil_Inside The reason is what you said, but I never realized it could be a problem. Mhmm, maybe I could add safe-mode to callbacks too, and cancel them if they throw an error? What you think?
     

    Attached Files:

  2. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    985
    Yes, having SafeMode deal with callbacks on destroyed objects behind the scenes would probably be a good idea.
    Right now I'm setting an ID for every tween with a callback, and I call DOTween.Kill(ID) in my object's OnDestroy method. Is there a better way to do that?
     
  3. fermmmm

    fermmmm

    Joined:
    Oct 18, 2013
    Posts:
    129
    Yes! the OnComplete problem is gone with that version!

    Now I need to tell you about another problem related to the same tween that only happens on my slow computer and not in my faster one, was not solved with this new version.
    The tween moves my character 1 tile and when the tween finishes, the character walks to the next tile creating the same kind of tween again inside the OnComplete callback, the movement through the map should look smooth but instead there is a delay of like 1 to 3 frames before the character moves to the next tile. It's like the tween takes time to start. The framerate is more or less 100 fps all the time, it's no so slow.
    In the faster computer this doesn't happen and the framerate is 1500 fps.
    I have another class that makes the same character walk through a path and there is no problem, the tween does the same but I use a tween with the Vector3 plugin instead of tweening the float X and Y properties:
    WalkTween = DOTween.To(() => Character.WordPos, p => Character.WordPos = p, targetPos, Character.WalkSpeed).
    SetSpeedBased().
    SetEase(Ease.Linear).
    OnComplete(GoToNextStep);

    I've checked a lot of things to make sure this is a DoTween problem, like commenting SetDelay and making sure parameters are Ok and execution is not duplicated.

    EDIT: Seems to happen only in the editor, when the game is running with a windows build this do not happen, this is probably because my computer is too slow to run Unity editor and my game smoothly so maybe is not a DoTween problem after all... I'm still not sure.
     
    Last edited: Feb 8, 2015
  4. Mr_Cad

    Mr_Cad

    Joined:
    Dec 7, 2013
    Posts:
    27
    Thanks for your reply. Just wonder why it doesn't happen in HOTween?

    Another question is, I realized that whenever I call .Pause(), .Kill() on a tweener, it doesn't stop immediately, it will still play for the next frame then only stop. Is that anyway I can really stop or kill it immediately? (I noticed this issue while running on mobile devices. It seems to be OK on Editor)
     
  5. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,228
    Guys just a warning to say that I'm in a superbusy mess until Wednesday. Will get back to check the comments then, sorry.

    @Devil_Iniside In the meantime yes, that sounds good. Other than storing references to your tween and just killing them directly.
     
  6. Manny Calavera

    Manny Calavera

    Joined:
    Oct 19, 2011
    Posts:
    205
    Hi, I just got DOTween a few minutes ago. I'm on Unity 5 RC1.

    I'm experiencing an issue where OnComplete() is not called if the duration of a tween coincides with the duration of another tween in a sequence.

    For instance, the following code repros consistently. The OnComplete() is not called. However, if you change the duration of the first tween from 0.2f to, say, 0.1f then the callback is executed. If you change them both to, let's say, 1f then the callback is not executed anymore. Strange.

    Can anyone give it a try?

    Code (CSharp):
    1.     public Transform SomeSprite;
    2.  
    3.     private void OnTriggerEnter2D(Collider2D collisionInfo)
    4.     {
    5.         if (collisionInfo.CompareTag(Constants.Player))
    6.         {
    7.             Sequence tweenSequence = DOTween.Sequence();
    8.             tweenSequence.Append(this.SomeSprite.DOLocalRotate(new Vector3(0f, 0f, 90f), 0.2f));
    9.             tweenSequence.Append(this.SomeSprite.DOPunchRotation(new Vector3(0f, 0f, -5f), 0.2f, 10, 0f /* elasticity */).OnComplete(
    10.                 () =>
    11.                 {
    12.                     Debug.Log("DOTween Callback!");
    13.                 }));
    14.  
    15.             this.GetComponent<Collider2D>().enabled = false;
    16.         }
    17.     }
     
  7. chetanisinanand

    chetanisinanand

    Joined:
    Oct 22, 2012
    Posts:
    22
    Hi,

    Is there any way to use Dotween(which is not actually tweening anything in game) to call a method after a delay (say 5 sec) ?
    I thought of doing a trick to scale a reference transform(not visible in game) and call MyMethod on completion :
    Code (CSharp):
    1. transform.DOScaleZ (1f,5f).OnComplete (MyMethod);
    However, I'ld like to do this without scaling the transform .
    like an empty tween with a delay which calls a method on completion.

    Anyway, Dotween is great, hats off to you and your team :)
     
  8. gjf

    gjf

    Joined:
    Feb 8, 2012
    Posts:
    30
    @chetanisinanand - why not just Invoke() with a delay?
     
  9. chetanisinanand

    chetanisinanand

    Joined:
    Oct 22, 2012
    Posts:
    22
    @ gjf - Thanks for replying , I'm using Coroutines most of the places,
    However ,Invoke and coroutines are not a good option for me as I want to invoke method with several parameters and then I've to cancelInvoke "MyMethod". But its not working as expected , I believe StopCoroutine/CancelInvoke works only when StartCoroutine/Invoke has been Started using a string method name .
     
  10. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    985
    I don't know about invokes, but I believe they've added StopCoroutine that takes an IEnumerator instead of a string.
     
  11. chetanisinanand

    chetanisinanand

    Joined:
    Oct 22, 2012
    Posts:
    22
    @ Devil_Inside: I never tested it , however as per their Documentation , only StartCoroutine using a string method name can be stopped using StopCoroutine.
    I'll test this. Anyways, please let me know if Dotween can do this , if its possible .
     
  12. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    985
    I don't think there is a way to create an empty tween, but this should work.
    Code (CSharp):
    1.  
    2. public void TestTimer()
    3. {
    4.     float tempVar= 0;
    5.     DOTween.To(x=>tempVar = x, 0, 5, 5).OnComplete(()=>TimerComplete(tempVar));
    6. }
    7.  
    8. void TimerComplete(float value)
    9. {
    10.     print("OLOLO:"+value);
    11. }
    12.  
    P.S. I still think that a Coroutine will be a more precise and a better solution for your task
     
  13. gjf

    gjf

    Joined:
    Feb 8, 2012
    Posts:
    30
    StopCoroutine takes the IEnumerator param - the docs have been updated - I've used it quite a bit...
     
    chetanisinanand and Devil_Inside like this.
  14. cybervaldez

    cybervaldez

    Joined:
    Aug 16, 2014
    Posts:
    87
    Hi guys, can anyone give me advice on how to use dotween to rotate around an object?
     
  15. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,228
    @Manny Calavera, @fermmmm, @Mr_Cad Checking your issues now.

    @chetanisinanand You can create empty Sequences and use them for that (and you can also make them timeScale independent) ;)
    Code (csharp):
    1. DOTween.Sequence().AppendInterval(5f).OnComplete(MyMethod);
    @cybervaldez No direct "rotate around object" tween method for now, sorry (but I'm thinking of adding that in the future). As a trick, you could add your target inside another empty gameObject (placed at the coordinates of the object you want to rotate around), and tween the rotation of the parent.
     
  16. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,228
    @Devil_Inside Voilà, the version I'm attaching implements safe mode also for callbacks. Let me know if you find any issue :) P.S. tweens won't be killed if a callback fails: they will simply ignore it and continue.

    @fermmmm I couldn't replicate that issue in any way. Let me know if you find out more, and if you manage to create a barebone project that replicates it on your slow computer throw it to me.

    @Manny Calavera I couldn't manage to replicate your issue, everything works great here. But maybe you encountered a problem which I solved in one of the latest non-official builds. Can you download the version attached (1.0.170) and tell me if that still happens? If it does, replicate it in a barebone project and attach it here so I can check it out.
     

    Attached Files:

  17. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    985
    Just tested it and it worked perfectly!
    Best asset with the best support!
    Thanks a lot!!!
     
    gjf likes this.
  18. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,228
    Wheeee ^_^ Gonna add a couple more things and then release the update on the website too.
     
    Devil_Inside and gjf like this.
  19. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    292
    New batch of small documentation fixes:

    Join(float atPosition, Tween tween)
    Shouldn't have the first argument at all (probably copy/paste from Insert...?).

    SetUpdate(UpdateType updateType, isIndependentUpdate = false)
    Second argument is missing the type (though it's clearly bool, so no worries :p).

    Typos:

    ReqindAll/Rewind(bool includeDelay = true)
    ReqindAll should be RewindAll.

    trasform.DOMoveX(45, 1).(...)
    (In the section "More on chaining")
    Use "transform" instead of "trasform". ;)

    That's it. Carry on! :D
     
  20. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    292
    Hmm... Isn't the DOComplete shortcut for Transforms missing from the library? I tried using it, and even in the most recent DOTween version it seems to be the only control method without a shortcut. :) I haven't tried with other component types.

    Also, more irrelevant stuff that I like to mention: search for "alpha to to given value". It appears several times and should probably be "to the" (or "alpha to the given one", as you use that too sometimes :)).
     
  21. monogon

    monogon

    Joined:
    Feb 10, 2014
    Posts:
    68
    Thanks, Izitmee!
    Why the "mySkinnedMeshRenderer.GetBlendShapeWeight(0)" in the beginning though? I am totally new to lambdas and don't understand why you seem to grab the value first with .GetBlendShapeWeight(0).
     
  22. meapps

    meapps

    Joined:
    May 21, 2013
    Posts:
    167
    just updated to 1_0_170 now my player movement is faster and not so smooth like before movement is also if i increase it make the movement slower and not faster.


    Example: (Gridmovement)
    transform.DOMove(new Vector3(Xpos, Ypos - GridS, Zpos), movementspeed).OnComplete(TweenCompleted).OnRewind(TweenCompleted);
     
  23. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    985
    The second parameter of DOMove is duration (the time it takes to complete the move), not speed.
     
  24. meapps

    meapps

    Joined:
    May 21, 2013
    Posts:
    167
    ah sry but has DoMove changed ?it looks now different the movement in the game.
     
  25. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    985
    Your movement might look different because the default Easing now is "OutQuad". I don't know what version you used before, but at some point the default Easing was "Linear".
     
  26. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    292
    Actually, I think it was set to Ease.InOutQuad before (by mistake), but yes, @meapps's problem might be related to the change to OutQuad.

    You can check the changes each version brings in this page (see "Changes" and "Old versions and Changelog").
     
  27. meapps

    meapps

    Joined:
    May 21, 2013
    Posts:
    167
    thank was the problem i just switched it back to InOutQuad
     
  28. Mr_Cad

    Mr_Cad

    Joined:
    Dec 7, 2013
    Posts:
    27
    One more question, is that possible to limit the axis that DOShakePosition change?

    Because I'm making a 2D game, and shake might shake the Z-axis which sometimes cause my objects gone because out of camera.
    I want it to shake only X, Y axis
     
  29. AGeorgy

    AGeorgy

    Joined:
    Sep 16, 2013
    Posts:
    37
    why??


    Code (CSharp):
    1. public List<Transform> Fans;
    2.  
    3. void Start()
    4.     {
    5.         Sequence mySequence = DOTween.Sequence();      
    6.         for( int i = 0; i < Fans.Count; i++ )
    7.         {
    8.             //  not Work
    9.             //mySequence.Insert( 0, DOTween.To( () => Fans[ i ].localEulerAngles, x => Fans[ i ].localEulerAngles = x, new Vector3( 360, 0, 0 ), fanSpeed ).SetEase( Ease.Linear ) );
    10.             // Work
    11.             mySequence.Insert( 0, Fans[ i ].DOLocalRotate( new Vector3( 360, 0, 0 ), fanSpeed ).SetRelative( true ).SetEase( Ease.Linear ) );
    12.         }
    13.         mySequence.SetLoops( -1, LoopType.Incremental );
    14.      
    15.     }
     
  30. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    292
    Don't quote me on this, but I believe you can specify the shake strength in all 3 axis if you use a Vector3 as the second argument to DOShakePosition, meaning you can probably set the z strength to 0. :)

    DOShakePosition(float duration, float/Vector3 strength, int vibrato, float randomness, bool snapping)

    By the way, @Izitmee, is there any method, besides the "Shake" ones, that receives the duration as the FIRST argument? I think it's a bit confusing, especially since the the second argument to Shakes can also be a float, and that can cause a programmer to switch the first two without noticing. For example, I would assume the duration would always come second. Without autocomplete (i.e. Sublime Text), people assume stuff. :p
     
  31. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,228
    @CanisLupus You are my hero, typos etc fixed thanks (including "alpha to the")! :) Also, damn! DOComplete was indeed missing! This attached version implements it (still waiting a little before website release to close a couple more things).
    About DOShake, I thought a while before deciding to set the duration as the first parameter. But the thing is, it's kind of an "automatic" tween (like DOSpiral too, when I'll finally release the Pro version), thus you can actually create it only with a duration parameter and all the other ones are all optional:
    Code (csharp):
    1. transform.DOShake(myDuration);
    @monogon The first lambda in the generic DOTween way represents how DOTween picks the current value at startup (useful when you don't start the tween immediately after creation). Check the picture here too, which should explain stuff :)

    @meapps @CanisLupus @Devil_Inside thanks for the support and sorry for the default ease change.

    @Mr_Cad As @CanisLupus said, you can pass a Vector3 which represents the amount of shake on each axis, and thus ignore the Z one by passing a 0.

    @AGeorgy EDIT: DOLocalRotate uses a rotation tween, while instead with the generic way you created a Vector tween which is different
     

    Attached Files:

  32. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    292
    @Izitmee Thanks for always fixing stuff quickly! ;) You're welcome about the fix reports and support. :p

    And also thanks for the Shake parameter explanation. I didn't notice that strength was also optional. In that case, I have no suggestions. XD Anyway, when more "automatic" methods are available this won't seem so strange.

    Keep up the good work. :)
     
  33. chetanisinanand

    chetanisinanand

    Joined:
    Oct 22, 2012
    Posts:
    22
    @Izitmee Post: #865
    Thanks a lot,This is what i was looking for
    Outstanding support ..
     
  34. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,185
    @Izitmee, I was wondering if it was possible to call DOPath(), and set the easing between the individual Waypoints on the path, instead of the easing for the entire path. I know currently there are other ways to do this, but I thought this would be helpful and useful for the library. If it's not in the library, would it be possible for you to implement that? Keep up the great work.
     
  35. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,000
    @Izitmee, great work!

    I ran into a minor issue... when using the DOPath, setting the options to closed path it adds an additional node at 0,0,0 world. I can get around it by making the path start at 0,0,0 but then I have to offset the locations. Is it possible there is some setting I am missing? I had done this in HOTween and it worked as expected. Not critical issue for us or anything, but thought I would bring it up.
    Thanks!
    ZG
     

    Attached Files:

  36. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,228
    @Ben BearFish That's not currently possible and it seems like hell to implement, but I'll ponder it :p

    @zombiegorilla Thanks! And ouch not good! I'll check and fix that but probably on Monday, since I'm practically out all weekend. P.S. nice new shiny sword!
     
  37. eydamson_pugeh

    eydamson_pugeh

    Joined:
    Feb 16, 2015
    Posts:
    2
    hi i have a question, is it alright if i use DOTween as my 2D character controller? will it affect the performance of my game(Andriod)?
     
  38. AGeorgy

    AGeorgy

    Joined:
    Sep 16, 2013
    Posts:
    37
    How to do it with the generic way?
     
  39. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,185
    @Izitmee , I had to do something similar using you HoTween, and my implementation ended up something like this.

    I had an array of tweens that represented how many points were in the path. Then I set each tween's easing to what I needed. This was usually a global setting, so I would for example set InOutQuad, and between each point the easing would be the same. On each tween's OnComplete, I would start the next tween, and keep doing so until I made sure I had reached the last one in the array, then if I wanted it to loop, I'd set it back to the first one in the array.

    I'm sure implementation-wise behind the scenes there's much more complexity for a DoPath, but maybe you could add an overload that does something like I mentioned? Or a separate method? Either-way I'm sure there's probably much more behind the scenes I'm overlooking, but I thought I'd make a suggestion.
     
  40. PhilllChabbb

    PhilllChabbb

    Joined:
    Sep 16, 2013
    Posts:
    8
    Howdy @Izitmee. The emoticon aficionado is back. Proof : ♪<('-')>♥ ( Hahaha! )

    I am curious, is there such a way to know if a Tween is currently at the start position of the animation? I've been using OnRewind() and it works wonderfully well. Is there a bool equivalence? MyTween.IsOnStart or something similar?

    For my current situation, I rewind the animations using negative TimeScale speed and check for a custom bool within OnRewind(); Would be mighty useful in certain parts to just check a bool.

    Having so much fun with DOTween, can't wait to get the pro version and support yo! ;D
     
  41. neroziros

    neroziros

    Joined:
    Aug 25, 2012
    Posts:
    129
    Hi @Izitmee, First of all let me say thanks for making such useful product!

    I was wondering if you have an ETA for the pro version. Right now I need to make some fixed tween paths but they are sorta complex and I'd like to make them through the visual editor :)
     
  42. monogon

    monogon

    Joined:
    Feb 10, 2014
    Posts:
    68
    Hi @Izitmee !

    Do you have any idea why this does not work?
    Code (CSharp):
    1. foreach (int i in tempList) {
    2.  
    3.     DOTween.To(()=> _sMeshRend.GetBlendShapeWeight(i), x => _sMeshRend.SetBlendShapeWeight(i, x), 0f, 2f);
    4.  
    5. }
    The according values of the according blend shape are not affected at all.
    However this works:
    Code (CSharp):
    1. foreach (int i in tempList) {
    2.  
    3.     _sMeshRend.SetBlendShapeWeight(i, 0f);
    4.  
    5. }
    So it's not the list, that is the problem. Do you have any hint what could be wrong?

    Edit: The tweens even show up as active in the DoTween Inspector but never seem to affect the given blend shapes within the foreach loop.... :-/
     
    Last edited: Feb 17, 2015
  43. Mr_Cad

    Mr_Cad

    Joined:
    Dec 7, 2013
    Posts:
    27
    Any updates on this issue?
     
  44. fermmmm

    fermmmm

    Joined:
    Oct 18, 2013
    Posts:
    129
    This happens because "i" is constantly being changed in every iteration of the for loop, and the lambdas keep reading "i" after the loop was completed, so save the current "i" value into a variable inside the foreach scope:

    Code (CSharp):
    1. foreach (int i in tempList)
    2. {
    3.     int index = i;
    4.    DOTween.To(()=> _sMeshRend.GetBlendShapeWeight(index), x => _sMeshRend.SetBlendShapeWeight(index, x), 0f, 2f);
    5. }
    @Izitmee I think It's a good idea if you write instructions in your webpage about how to create a tween inside a for and foreach loop like that, since using lambdas can be very confusing for beginners but it's one of the best features of DoTween
     
    Last edited: Feb 18, 2015
    monogon likes this.
  45. monogon

    monogon

    Joined:
    Feb 10, 2014
    Posts:
    68
    @fermmmm
    Thank you! :) That was it... I am new to lambdas and actually don't understand them fully at the moment. Will read into this topic soon because I really want to understand them completely.
     
  46. fermmmm

    fermmmm

    Joined:
    Oct 18, 2013
    Posts:
    129
    I'm getting 2 errors at the same time in random moments with this tween:

    Code (CSharp):
    1.   // Set alpha to 0
    2.   Color C  = Renderer.color;
    3.   C.a  = 0f;
    4.   Renderer.color  = C;
    5.   RespawnAnimation = DOTween.Sequence();
    6.   RespawnAnimation.Append(DOTween.ToAlpha(()=>Renderer.color, (c)=>Renderer.color = c, 1f, .6f));
    7.   RespawnAnimation.OnComplete(OnRespawnAnimationFinishes);
    Error 1:

    IndexOutOfRangeException: Array index is out of range.
    (wrapper stelemref) object:stelemref (object,intptr,object)
    DG.Tweening.Core.TweenManager.AddActiveTween (DG.Tweening.Tween t) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween.Assembly/DOTween/Core/TweenManager.cs:683)
    DG.Tweening.Core.TweenManager.GetSequence () (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween.Assembly/DOTween/Core/TweenManager.cs:121)
    DG.Tweening.DOTween.Sequence () (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween.Assembly/DOTween/DOTween.cs:578)
    ItemBase.StartRespawnAnimation () (at Assets/Scripts/Core/Tools/ItemBase.cs:108)
    ItemBase.Reset () (at Assets/Scripts/Core/Tools/ItemBase.cs:207)
    RiskBattle+<RespawnItem>c__AnonStorey9.<>m__15 () (at Assets/Scripts/Core/GameModes/RiskBattle.cs:75)
    DG.Tweening.Tween.DoGoto (DG.Tweening.Tween t, Single toPosition, Int32 toCompletedLoops, UpdateMode updateMode) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween.Assembly/DOTween/Tween.cs:238)
    DG.Tweening.Core.TweenManager.Update (UpdateType updateType, Single deltaTime, Single independentTime) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween.Assembly/DOTween/Core/TweenManager.cs:386)
    DG.Tweening.Core.DOTweenComponent.Update () (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween.Assembly/DOTween/Core/DOTweenComponent.cs:49)

    Error 2:

    IndexOutOfRangeException: Array index is out of range.
    (wrapper stelemref) object:stelemref (object,intptr,object)
    DG.Tweening.Core.TweenManager.AddActiveTween (DG.Tweening.Tween t) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween.Assembly/DOTween/Core/TweenManager.cs:683)
    DG.Tweening.Core.TweenManager.GetTweener[Color,Color,ColorOptions] () (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween.Assembly/DOTween/Core/TweenManager.cs:95)
    DG.Tweening.DOTween.ApplyTo[Color,Color,ColorOptions] (DG.Tweening.Core.DOGetter`1 getter, DG.Tweening.Core.DOSetter`1 setter, Color endValue, Single duration, DG.Tweening.Plugins.Core.ABSTweenPlugin`3 plugin) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween.Assembly/DOTween/DOTween.cs:816)
    DG.Tweening.DOTween.ToAlpha (DG.Tweening.Core.DOGetter`1 getter, DG.Tweening.Core.DOSetter`1 setter, Single endValue, Single duration) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween.Assembly/DOTween/DOTween.cs:375)
    ItemBase.StartRespawnAnimation () (at Assets/Scripts/Core/Tools/ItemBase.cs:109)
    ItemBase.Reset () (at Assets/Scripts/Core/Tools/ItemBase.cs:207)
    RiskBattle+<RespawnItem>c__AnonStorey9.<>m__15 () (at Assets/Scripts/Core/GameModes/RiskBattle.cs:75)
    DG.Tweening.Tween.DoGoto (DG.Tweening.Tween t, Single toPosition, Int32 toCompletedLoops, UpdateMode updateMode) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween.Assembly/DOTween/Tween.cs:238)
    DG.Tweening.Core.TweenManager.Update (UpdateType updateType, Single deltaTime, Single independentTime) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween.Assembly/DOTween/Core/TweenManager.cs:386)
     
  47. Afif-Faris

    Afif-Faris

    Joined:
    Oct 11, 2013
    Posts:
    16
    Hi,
    Is there anyway to get all tweens with certain id?
    I have several tweens and group them with ids. So, I want to get a group of tweens (with the assigned id) and make the time scale lower of faster.
    Something like
    Code (CSharp):
    1.  
    2. var TweenGroup =  DOTween.GetTweens("GroupA");
    3. foreach(var tween in TweenGroup){
    4.      tween.timeScale=0.5f;
    5. }
    6.  
    I know, I can implement it using dictionary but I think its more simple as DOTween already use id for doing something like DOTween.Kill("GroupB");
     
  48. s1m0n1stv4n

    s1m0n1stv4n

    Joined:
    Sep 14, 2012
    Posts:
    14
    Hi,

    Let's say I have a tween that moves a cube to a target object's position. What if that target moves during the tween, and I want the cube to tween to the target's actual position until it is reached?
     
  49. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    215
    Hallo! I'm transitioning from HOTween to DOTween right now - DOTween is awesome!

    Just wanted to know if it's possible to have time scale independent updates as default? In HOTween I could write

    Code (csharp):
    1. HOTween.defUpdateType = HOTween.UpdateType.TimeScaleIndependentUpdate;
    but DOTween is missing this UpdateType. Is there a specific reason for that?
     
  50. Rustamovich

    Rustamovich

    Joined:
    Sep 5, 2014
    Posts:
    30
    Hi there! Thanks for that super asset! I'm new to tween animation and i got some basic questions. here is my code:
    Code (CSharp):
    1.  
    2.   Sequence MUpSeq;
    3.    void Start () {
    4.      DOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(200, 10);
    5.    }
    6. IEnumerator MovingUp () {
    7.   MUpSeq = DOTween.Sequence();
    8.         MUpSeq.Append (transform.DOMove (new Vector3 (myPositionX, myPositionY + 1.5f, myPositionZ), 0.165f))
    9.             .Join (transform.DORotate (new Vector3 (0, 0, -180), 0.33f))
    10.                 .Insert (0.160f, transform.DOMove (new Vector3 (myPositionX + 1, myPositionY + 1, myPositionZ), 0.165f));
    11.  
    1) As I call this IEnumerator with mouseclick, after first click I've got this warning in Console:
    Why this appears? what I am doing wrong?
    I thought about that every time I click Sequence generates and stores, so maybe I need call DOTween.Play("MUpSeq") Am I right? And when I need to store my tweens?

    2) Look at my Sequence, I want to rotate object during both transforms. How I can do this? it works only when I click for first time

    3) How can I check is any Sequence is played?

    Thanks in Advance!! Plugin really great!
     
    Last edited: Feb 18, 2015
unityunity