Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

DOTween (HOTween v2), a Unity tween engine

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

  1. Gus3D

    Gus3D

    Joined:
    Dec 1, 2014
    Posts:
    27
    Congratulations! This is looking great! Looking forward to Pro. Question: Is there a way for DOTween to keep working even with Time.timeScale set to zero? Say I pause the game using Time.timeScale but want to keep animating UI stuff on the pause screen using DOTween. Thanks in advance!
     
  2. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @Gus3D Thanks! And sure, just use SetUpdate passing TRUE as the second parameter, and that particular tween/sequence won't care anymore about Unity's timeScale :)
     
  3. AlfonsoC

    AlfonsoC

    Joined:
    Oct 1, 2014
    Posts:
    27
    @Izitmee wow thank you, this was my fault, again amazing work and so easy to use i hope to see soon the examples in the web :)
     
  4. Gus3D

    Gus3D

    Joined:
    Dec 1, 2014
    Posts:
    27
    @Izitmee It works! Awesome, you've thought of everything.
     
  5. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Great :)

    @AlfonsoC If you get DOTween from the Asset Store it comes with some basic examples. Will try to add them to the website too as soon as possible.
     
  6. AlfonsoC

    AlfonsoC

    Joined:
    Oct 1, 2014
    Posts:
    27
    @Izitmee Great!! i installed the web one :p i will download from the asset thanks :)

    PD: if you think to translate the doc of the web or the example to other languages i'm from spain and can help you if you need.
     
    gjf likes this.
  7. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Thanks a lot for the translation offer, but it would be overkill to change all language versions each time I add a new feature (also because I plan to add a lot of stuff in the future), so I will politely refuse and protect our sanity :p
     
  8. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
    First of all, thanks for DOTween! I really like the simplified way of doing some things compared to HOTween.

    There's a bug somewhere with running tweens with different UpdateTypes and delays. I poked at the DOTween code but nothing jumped out at me immediately.

    Here's the simplest reproduction I could do:

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using DG.Tweening;
    5. using System;
    6.  
    7. public class SimpleTest : MonoBehaviour
    8. {
    9.     public float test1 = 0f;
    10.     public float test2 = 0f;
    11.  
    12.     bool running = false;
    13.  
    14.     void Update()
    15.     {
    16.         if(Input.GetKeyDown("space"))
    17.         {
    18.             Test();
    19.         }
    20.     }
    21.  
    22.     void Test()
    23.     {
    24.         running = true;
    25.  
    26.         DOTween.To(() => test1, x => test1 = x, 1f, 1f)
    27.             .SetEase(Ease.OutSine)
    28.             .SetUpdate(UpdateType.Late, true)
    29.             .OnComplete(() => test1 = 0f);
    30.  
    31.         // BUG:  this tween will stick if set to UpdateType.Default and not UpdateType.Late
    32.         // mixing-and-matching UpdateType will cause bugs, but not one or the other
    33.  
    34.         DOTween.To(() => test2, x => test2 = x, 1f, 1f)
    35.             .SetEase(Ease.OutSine)
    36.             .SetUpdate(UpdateType.Default, true)
    37.             .SetDelay(0.25f) // only shows up if a delay is set here
    38.             .OnComplete(() => test2 = 0f);
    39.     }
    40.  
    41.     void OnGUI()
    42.     {
    43.         GUILayout.BeginVertical("box");
    44.         GUILayout.Label("Running: " + running);
    45.         GUILayout.Label("Test1: " + String.Format("{0:0.00}", test1));
    46.         GUILayout.Label("Test2: " + String.Format("{0:0.00}", test2));
    47.         GUILayout.Label("Time: " + String.Format("{0:0.00}", Time.realtimeSinceStartup));
    48.         GUILayout.EndVertical();
    49.     }
    50. }
    51.  

    The second tween sticks and never finishes:



    Its OnComplete never fires, will still report true with IsActive, etc. I recently switched our project from HOTween to DOTween, and this took quite awhile to figure out. Only seems to happen if tweens of different UpdateType are running together, so was showing up pretty sporadically for me!

    Bug report aside:

    UpdateType Default

    I feel like UpdateType would make more sense as:

    - UpdateType.Default
    - UpdateType.Normal
    - UpdateType.Late

    With the addition of DOTween.defaultUpdateType set to Normal. I'm putting UpdateType.Late on everything for lifecycle reasons, but really I'd like to make it the real default. It seems confusing to call normal Update the default.

    UpdateType.Fixed

    Also, I'd love to to have UpdateType.Fixed available. Most of our gameplay exists in FixedUpdate, and sometimes we tween gameplay numbers. I realize this has a lot of caveats, like FixedUpdate not firing at timeScale=0, but the option would be great for people who want it.

    Not firing at zero does mean you can just do Time.deltaTime / Time.timeScale for independent time, since FixedUpdate doesn't happen at zero. I don't think Time.realTimeSinceStartup maps well to FixedUpdate at high frequencies, since multiple ticks happen between frames.
     
  9. yuhe

    yuhe

    Joined:
    Dec 20, 2012
    Posts:
    11
    Hi, thanks for this great tweening library. I was using a previous version of DOTween earlier, before I upgraded to 1.0.010 today. In the previous version, the API had .onComplete (multicast event) in addition to OnComplete(). Seems like OnComplete only allows a single delegate, and you can't remove or retrieve a previously assigned delegate without overwriting it. Would it be possible to have this functionality back?
     
  10. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I am not sure if this is discussed before, but I really liked first Daikon GUI tween component where you are able to set up tweens using component based set up by inspector. (only downside is its GC stuff and no option to set time scale dependent tweens)

    So my finger crossed hope is that if DoTween is going paid pro version , then is there any chance editor friendly tween components be available?

    It's ok to code tween in by code, but it is very useful to be able to set up values of tweens by using editor and just getcomponent the tweens/sequences and play/stop that.

    ? :D
     
  11. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @MatthewW I worked on it for a while and managed to understand the reason why that's happening. Working on a fix now.

    About Update.Default, now that you mention it I see that you're right. But I'd prefer not to change the API now that DOTween is out of alpha. I'll have to ponder about it a little more. By the way, you can indeed make LateUpdate the default (which would mean it would be automatically used when SetUpdate is not overriding it, and not that it replaces UpdateType.Default - again, I see I made a wrong language choice there) by setting:
    Code (csharp):
    1. DOTween.defaultUpdateType = UpdateType.Late,
    About UpdateType.Fixed, the problem is not much timeScale 0, but that adding it would make DOTween slightly slower. I'll think about it more though.

    @yuhe I removed onComplete because people were using it by error instead of OnComplete. You can still use OnComplete and pass it any function you want by using lambdas:
    Code (csharp):
    1. myTween.OnComplete(()=> MyFunctionWParams(param0, param1));
    Also, if you want to overwrite the onComplete delegate or set it to NULL, you can call OnComplete at any time on your tween.

    @castor76 HOTween (the previous version of DOTween) had a tween creation inspector, but to be honest I don't know if I'll make it for DOTween too (but there were a couple users interested in making it themselves). For now Pro will contain a Path Inspector though :)
     
  12. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @MatthewW P.S. about defaultUpdateType, sorry, I got confused and you can't do it :B I'm adding the option now.
     
  13. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @MatthewW Ok UpdateType.Normal is simply too right, so I made a terrible thing and changed the API. UpdateType.Default is now named UpdateType.Normal. Also, I fixed that bug and added DOTween.defaultUpdateType. Can you check the attached version to see if everything works ok with you?
     

    Attached Files:

  14. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    It's not terrible if it makes it better for everyone!
     
  15. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
  16. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
    Looks good! One piece of weirdness is calling SetUpdate(true) now, which uses UpdateType.Normal (and should probably use the global default instead):

    https://code.google.com/p/dotween/source/browse/trunk/DOTween/TweenSettingsExtensions.cs#181

    Regarding FixedUpdate:

    I guess it would mean adding FixedUpdate to the DOTween updates. I'd be happy to #DEFINE it in, but I guess that adds another layer of complexity to things...
     
  17. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
    I should quick add: I think you would only want to #DEFINE in the master FixedUpdate() callback in the DOTweenComponent or whatever, rather than all functionality for it. (And maybe throw an editor warning if someone is trying to use UpdateType.Fixed without the define?)

    But to be honest, FixedUpdate tweens are just a "nice to have" thing for us. It would help Aztez be slightly tighter-feeling in how we handle our hit stops and time freezes, but not by a huge amount or anything...
     
  18. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @MatthewW Damn I thought I replaced everything with DOTween.defaultUpdateType but I forgot that one (this week I'm releasing Goscurry on Steam, among other things, so I'm kind of in a crazy rush with everything). Thanks for pointing it out :) Here's an updated version attached.
    About FixedUpdate, mhmm I didn't think of implementing it as a #DEFINE. That's an interesting way to keep everything light if it's not used, though I'm not very keen about the usability side. Will definitely ponder about it!

    P.S. Aztez looks awesome! Bows to that!
     

    Attached Files:

  19. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
    Good luck with the release!

    I don't think having a permanent FixedUpdate() in DOTween would be that heavy, as long as the bool check was actually static and not calculated upon access or whatever...

    Code (csharp):
    1.  
    2. void FixedUpdate()
    3. {
    4.     if (TweenManager.hasActiveFixedTweens) {
    5.     ///
    6.  
    But anyway--if it makes it in we'll use it (and I think others who tween gameplay values with FixedUpdate-based logic might too), but otherwise no worries!
     
  20. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Nono wouldn't be heavy at all, just slightly slightly less light, and I was worried even about that. That said, I thought about it and I decided I'll do it. And since I'm crazy I did it already :D If you want to give it a run, here's a version which includes UpdateType.Fixed.

    Remember that when using shortcuts, you can use DOMove etc from a rigidbody reference instead than a transform, and in that case rigidbody.MovePosition/MoveRotation will be used in the background, for smoother movement.

    EDIT: actually, I'm even gonna release it officially in the next post, since everything seems to work correctly
     

    Attached Files:

    Last edited: Jan 13, 2015
  21. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    NEW UPDATE 1.0.030
    • CHANGE: Renamed UpdateType.Default to UpdateType.Normal (to avoid confusion when using the new DOTween.defaultUpdateType option)
    • NEW: Added UpdateType.Fixed option, to make tweens update during FixedUpdate
    • NEW: Added DOTween.defaultUpdateType
    • BUGFIX: Fixed issue where using different UpdateTypes together could cause issues when killing/autokilling tweens
    • BUGFIX: Fixed issue where calling Clear then immediately creating new tweens could generate duplicate DOTween objects (and double or more each tween's speed)
     
  22. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
    Thanks for doing this!

    I think you'll need to do one of two things for delta time in the update, though. Right now, for timescale-independent stuff you're reusing the delta time calculated in Update(), but if physics is running much faster or slower than graphics frame rate that's going to be incorrect.

    We run Aztez at 120Hz, and I think a lot of mobile games try to run much less than frame rate and interpolate). I know of desktop games that run physics at 240Hz :eek:

    Since FixedUpdate never fires at Time.timeScale=0, I think this is your best bet:

    Code (csharp):
    1.  
    2. void FixedUpdate()
    3. {
    4.     if (TweenManager.hasActiveFixedTweens) {
    5.         TweenManager.Update(UpdateType.Fixed, Time.fixedDeltaTime * DOTween.timeScale, (Time.fixedDeltaTime / Time.timeScale) * DOTween.timeScale);
    6.     }
    7. }
    8.  
    I'm not sure offhand how reliable Time.realTimeSinceStartup is within physics loops, but the other solution is just using a different _unscaledDeltaTime that's updated from within FixedUpdate.

    With Aztez as an example, if our graphics is at 40fps and the last frame took 3ms to render, Unity will need to tick physics three times in a row. I don't think Time.realTimeSinceStartup will be updated in between ticks, and if it is it might be the actual time to compute each frame (instead of the forced time advance).

    I'm not aware of any games that use the Maximum Allowed Timestep setting in Time Manager, but if you push that down you end up with arcade-style slowdown where game time starts to fall behind real time when things get heavy. In that situation realTimeSinceStartup is definitely going to fall out of sync.
     
  23. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Ooops yes, I completely ignored the independent fixed timeScale issue (sorry I'm usually pretty precise, but this week is making my brain explode). Time.realtimeSinceStartup is indeed updated within ticks, but yes, as in your example it will be just the actual time to compute each frame so even a different unscaledDeltaTime taken within FixedUpdate wouldn't work.

    Here is an update which implements your suggestion, which is the only functional way in my opinion too (but I'll investigate more). That said, I actually was thinking of completely disallowing indepentUpdate with Fixed update tweens (or at least warn against it). Thing is, if the timeScale is lowered, Unity will actually increase the TimeStep and call FixedUpdate less frequently (for example, if timeScale is 0.5, FixedUpdate will be called at double the regular time). So, even if we find the right time-independent position the actual update will stutter, and that kind of sucks. That is, unless the users also change the fixedTimeScale to re-adapt to a change in timeScale and maintain a constant timeStep.
     

    Attached Files:

  24. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
    FixedUpdate is definitely a tricky beast. We do re-scale fixedDeltaTime when timeScale changes, but we also do lots of time shifting in general and have a manager in place for it (we also can pitch scale our sound effects and things). Casual users could definitely get themselves into some situations where things just feel bad without understanding why :/
     
  25. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Yup tricky beast indeed. But I might just leave it as is (after more testing etc) and put some warnings in the FAQ etc.

    By the way, a general warning. Tomorrow I'll travel back to Italy (sigh sigh). Long travel and then I'll have to settle some things, so I won't be available from tomorrow to Thursday afternoon (Italy time).
     
  26. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74
    Does this work with Unity 4.6.1p3, i.e. on 64 bit iOS builds?
    I'm getting some runtime error which looks like it could stem to this DOTween plugin - still not sure what went wrong and this is a Unity beta anyway, however you probably need to make sure your plugin works on iOS 64 bit anyway?
     
  27. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Hey @Umai, please paste the full error log you're getting so I can check it out and see if it's truly related to DOTween.
     
  28. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74
  29. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74
    Oh anyway it doesn't look like DOTween is causing the problem...
     
  30. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Got it! It's not a DOTween issue. You see DOTween in the log chain simply because the error is generated by a function which is called by one of your tween's callbacks, but the culprit is Poker.ratingOfPokerHand. Still, it just seems like a Unity beta bug, because the error says Unity can't find generic List type which is simply absurd.

    EDIT: ooops same-time reply :)
     
  31. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,042
    You should have a page on your website showing how to migrate from HOTween to DOTween with some examples.

    For example I have some problems:

    How it's the right way to change this on DOTween? I mean, a Tween that had "AutoKill(false)" I check if it's destroyed or not and then I reset it.

    Code (CSharp):
    1. if (tweener == null || tweener.destroyed) {
    2.      tweener = HOTween.To(this, fadeTime, parms);
    3. } else {
    4.      tweener.ResetAndChangeParms(TweenType.To, fadeTime, parms);
    5. }
    And this? I mean tween two variables at the same time (generic way not being transform, rigidbody, etc...)

    Code (CSharp):
    1. HOTween.To(target, 1, new TweenParms()
    2. .Prop("a", 1);
    3. .Prop("b", new PlugVector3(Vector3.one));
     
  32. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Hi @N3uRo, you're right, I should add a "transition" page. Will do that as soon as possible (not this week though because it's supercrazy).

    About your issues. The first code would look like this:
    Code (csharp):
    1. if (tweener == null || tweener.IsActive())...
    Checking for IsActive is the same as checking for destroyed in HOTween.

    For the second part of that code, ResetAndChangeParms has no equivalent, because DOTween reuses stuff automatically so there's no need: just create a new tween. That said, if you just want to change the start/end values you can keep the same tween and use ChangeStart/End/Values.

    About tweening two variables at the same time instead, I have to say that's the only thing HOTween could do that DOTween can't, and you'll have to create a Sequence for that. There are various reasons for this choice, but the main reason is that it keeps a DOTween Tweener much lighter than an HOTween one (and even a DOTween Sequence is much lighter than a HOTween Tweener tweening two values).
     
  33. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,042

    Thanks but I don't understand how I can tween two values with a Sequence at the same time. A sequence is as it says to "sequence". It will run tweeners one by one.

    Edit: Nevermind I read this:

    "The sequenced tweens don't have to be one after each other. You can overlap tweens with the Insert method."
     
  34. thempus

    thempus

    Joined:
    Jul 3, 2010
    Posts:
    61
    Any chance you can write some uniRX extensions to make DOTween observable in some cases?
     
    Trinary and MikeTon like this.
  35. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    I updated to DOTween via UAS and I ended up, in addition to DOTween folder, with another one Demigiant > DOTween

    So surprise there, but it kept showing red lines about rectTransform.DOAnchorPos (it is 1:00 am over here) so I ended up not following through with the update because it was too messy. Am I missing something? I restarted both Unity and Monodevelop and it wasn't a smooth import. I assumed the folder Demigiant was the correct one, but DOTween namespace wasn't recognized with DOTween inside the Demigiant folder.

    Another question. How do I know which script is killing a DOTween tween? I have DOTween.Init (true, true, LogBehaviour.Verbose); but I can't see what and where is killing my tween.

    Thanks
     
  36. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @gegagome The Asset Store version is packed inside a Demigiant folder to be consistent with eventual plugins I might publish later, but you can't have both the Demigiant/DOTween folder and another DOTween folder in your project: they're the same thing and there will be conflicts :p So I suggest you remove the regular DOTween folder when updating from the Asset Store (or move it inside a Demigiant folder so the correct elements will be overwritten). I'll add a note to the website to make this more clear.

    About knowing when a tween is killed, you can use the OnKill callback:
    Code (csharp):
    1. myTween.OnKill(()=> Debug.Log(myTween + " was killed));
     
    Last edited: Jan 15, 2015
  37. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @gegagome On further thought, I will actually upload future DOTween versions inside a Demigiant folder even from the website, so there won't be consistency issues ;)
     
  38. yuhe

    yuhe

    Joined:
    Dec 20, 2012
    Posts:
    11
    I'm currently using it with UniRx like this:

    Code (CSharp):
    1.    public static class DOTweenSequenceExtensions {
    2.         public static IObservable<Unit> OnRewindAsObservable(this Sequence sequence) {
    3.             return Observable.FromEvent(
    4.                 x => new DG.Tweening.Core.TweenCallback(x),
    5.                 x => sequence.OnRewind(x),
    6.                 _ => sequence.OnRewind(delegate { }));
    7.         }
    8.  
    9.         public static IObservable<Unit> OnCompleteAsObservable(this Sequence sequence) {
    10.             return Observable.FromEvent(
    11.                 x => new DG.Tweening.Core.TweenCallback(x),
    12.                 x => sequence.OnComplete(x),
    13.                 _ => sequence.OnComplete(delegate { }));
    14.         }
    15.     }
    It's not perfect since DOTween no longer expose proper events (ie. if you call sequence.OnCompleteAsObservable() more than once, the previous one will be overwritten).
     
    MikeTon and thempus like this.
  39. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @thempus Ooops sorry, I replied you but it ended up as code. I was saying that I never hear dof uniRX before, so I'd need more information about it.

    @yuhe That sounds cool (even if I don't fully understand the logic/usage :B)
     
    thempus likes this.
  40. cybervaldez

    cybervaldez

    Joined:
    Aug 16, 2014
    Posts:
    87
  41. yuhe

    yuhe

    Joined:
    Dec 20, 2012
    Posts:
    11
    It's kinda like LINQ, but for events/signals. You create an IObservable<T> (analogous to IEnumerable<T>), which you can Select(), Where(), TakeWhile(), etc. You also have additional stuff like Delay(), Catch(), Finally(), Timeout(), etc. It's helpful for avoiding callback hell, particularly for network services, so you don't have a bunch of OnSuccess, OnNetworkError, OnCancel, and so on. Example for DOTween:

    Code (CSharp):
    1. sequence.OnStepCompleteAsObservable()
    2.     .Take(3)
    3.     .Count()
    4.     .Subscribe(x => UnityEngine.Debug.Log(x))
    Will output:

    1
    2
    3
     
  42. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    So the problem with the import wasn't quite the Demigiant folder... even after I fixed it I got a bunch of compiling errors, but let me confirm when I try the update again.

    About OnKill()
    When I do this:
    menuExposer = DOTween.Sequence ().SetAutoKill (false).Pause ().OnKill(()=> Debug.Log(menuExposer + " was killed"));

    I just get the normal verbose log in the inspector, but no log with information about what script is killing my tweens. Somehow it appears that this Sequence is getting constantly killed.

    DOTWEEN :: This Tween has been killed and is now invalid
    UnityEngine.Debug:LogWarning(Object)
    DG.Tweening.Core.Debugger:LogWarning(Object) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween.Assembly/DOTween/Core/Debugger.cs:22)
    DG.Tweening.Core.Debugger:LogInvalidTween(Tween) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween.Assembly/DOTween/Core/Debugger.cs:36)
    DG.Tweening.TweenExtensions:playBackwards(Tween) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween.Assembly/DOTween/TweenExtensions.cs:128)
    SceneMenu:GearIconRotator() (at Assets/Resources/Scripts/Numbers/SceneMenu.cs:83)
    SceneMenu:LoadMap(String) (at Assets/Resources/Scripts/Numbers/SceneMenu.cs:51)
    UnityEngine.EventSystems.EventSystem:Update()

    UPDATE:
    The problem is DOTween.Kill(); that I have in another script, and somehow is preventing all Sequences from loading in subsequent calls, yet all unSequenced tweens play fine.
    The idea is that I need to kill all current tweens/sequences but DOTween.Kill(); is preventing/killing all Sequences from ever playing again.
    Note that the line DOTween.Kill(); is only called only once and it does what it is supposed to do, but afterwards normal tweens play but sequences are killed.

    Thanks
    ps: I'd still like to know why OnKill() wouldn't work and how to know what script is killing a tween for the future reference.
     
    Last edited: Jan 15, 2015
  43. thempus

    thempus

    Joined:
    Jul 3, 2010
    Posts:
    61
    Awesome thanks for sharing :)
     
  44. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Thanks @cybervaldez :) And @yuhe that sounds very cool.

    @gegagome Please let me know of those compiling errors :O Maybe there's something wrong with the Setup? Can you show me a screenshot of your Project panel after importing DOTween etc, with the DOTween folder expanded?

    About OnKill, I just tested it again and it works correctly here (plus the final line of the log shows what started the Kill action - if there was one and the tween wasn't automatically killed at completion I mean). Also, DOTween.Kill kills correctly both Tweeners and Sequences. Can you replicate this issue and send the project to me to check it out?

    By the way, please note that today I will probably be away or not very supportive, I apologize for that. It's Goscurry's release day and I have tons and tons of things to do. Eeek! *_*
     
  45. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Hi @Izitmee Congrats on the release of Goscurry!!! I can't even image the joy mixed up with sky-high stress levels... :)

    And of course I have chosen this day to discover a bug in DOTween! Here are the console errors. I believe it is liked to the fact that an object which has tweens running is destroyed and DOTween doesn't seem to like that:

     
  46. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    NEW UPDATE 1.0.035
    • NEW: Implemented timeScale-independent update with UpdateType.Fixed (though it's not recommended)

    @Seith Perfect timing (and yes, joy plus high stress levels plus terrible fear) :D First of all, can you update this last version of DOTween? Otherwise your error lines are different than mine and I don't know where to look exactly.
     
  47. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    So I just updated and well... The update didn't go well. :/ I now have several errors saying this:

    error CS1928: Type `ActorGUI.iconCanvasGroup' does not contain a member `DOFade' and the best extension method overload `DG.Tweening.ShortcutExtensions.DOFade(this UnityEngine.Material, float, float)' has some invalid arguments

    This is happening on a line that didn't cause any problem before:

    Code (CSharp):
    1. // Fade the canvas' alpha.
    2. iconCanvasGroup.DOFade(1f, .2f);
    I looked at the doc page and it doesn't seem like anything's changed on the way to use DOFade on a CanvasGroup. Am I doing something wrong?

    Update:
    Meanwhile I'll go back to the previous version I was using, as this is obviously keeping me from compiling any script...
     
    Last edited: Jan 16, 2015
  48. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    That means the setup didn't import the DOTween46 library correctly, so DOFade can't be found for UI elements. This sounds similar to the import issue @gegagome was having, so now it's two of you. I just tested it on a sample project (both by overwriting the DOTween folder with Unity open and with it closed) and everything is correctly setup here. Can you tell me how you're updating? Did you run DOTween Setup from the utility panel? After the setup, did you get a message saying 2 additional libraries were imported? Can you try again and send me a screenshot of your DOTween folder's contents after that (from outside Unity, so I can see all file extensions correctly)?

    Supersorry for this issue!
     
  49. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    P.S: you can enable the DOTween46 library manually by removing its "addon" extension after importing, but I'd like to understand what's happening with the auto-setup.
     
  50. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Alright, so the way I'm doing the update is as follows (very similar to what we did together once over Skype):

    1) I go to the DOTween page, download the latest version.
    2) While Unity is open, I go with Windows explorer and delete everything within the DOTween folder.
    3) Then I copy the content of the downloaded RAR file inside the windows explorer DOTween folder.
    4) Finally I switch back to Unity to let it find and compile the DOTween folder.

    No message about 2 libraries or anything. Please let me know if there's better way to handle the update and I'll try it right away...!

    Screenshot of the folder with the old (but functional) version:



    Screenshot of the folder with the new (but broken) version: