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

HOTween: a fast and powerful Unity tween engine

Discussion in 'Assets and Asset Store' started by Demigiant, Jan 7, 2012.

  1. aholla

    aholla

    Joined:
    May 27, 2014
    Posts:
    81
    @Izitmee Hi thanks for the feedback but I must have not explained myself correctly. Here is an example of my current code:

    Code (CSharp):
    1. public int valueA = 0;
    2. public int valueB = 0;
    3. public int valueC = 0;
    4.  
    5. private int targetA = 100;
    6. private int targetB = 200;
    7. private int targetC = 300;
    8.  
    9. private UILabel labelA;
    10. private UILabel labelB;
    11. private UILabel labelC;
    12.  
    13. void Start() {
    14.  
    15.    labelA.text = valueA.ToString();
    16.    labelB.text = valueB.ToString();
    17.    labelC.text = valueC.ToString();
    18.  
    19.    HOTween.To( this, 1.0f, new TweenParms()
    20.       .Prop( "valueA", targetA )
    21.       .OnUpdate( OnUpdateACallback ) );
    22.  
    23.    HOTween.To( this, 1.0f, new TweenParms()
    24.       .Prop( "valueB", targetB )
    25.       .OnUpdate( OnUpdateBCallback ) );
    26.  
    27.    HOTween.To( this, 1.0f, new TweenParms()
    28.       .Prop( "valueC", targetC )
    29.       .OnUpdate( OnUpdateCCallback ) );
    30. }
    31.  
    32. // BELOW, MULTIPLE CALLBACKS
    33.  
    34. void OnUpdateACallback( TweenEvent e ) {
    35.    labelA.text = valueA.ToString();
    36. }
    37.  
    38. void OnUpdateBCallback( TweenEvent e ) {
    39.    labelB.text = valueB.ToString();
    40. }
    41.  
    42. void OnUpdateCCallback( TweenEvent e ) {
    43.    labelC.text = valueC.ToString();
    44. }
    45.  
    There is a lot of repetition here and ideally I would like all the tweens to use the same callback but pass the params for it to use. This is an example

    Code (csharp):
    1. void Start() {
    2.  
    3.    labelA.text = valueA.ToString();
    4.    labelB.text = valueB.ToString();
    5.    labelC.text = valueC.ToString();
    6.  
    7.    HOTween.To( this, 1.0f, new TweenParms()
    8.       .Prop( "valueA", targetA )
    9.       .OnUpdate( OnGenericUpdateCallback, labelA, valueA ) );
    10.  
    11.    HOTween.To( this, 1.0f, new TweenParms()
    12.       .Prop( "valueB", targetB )
    13.       .OnUpdate( OnGenericUpdateCallback, labelB, valueB) );
    14.  
    15.    HOTween.To( this, 1.0f, new TweenParms()
    16.       .Prop( "valueC", targetC )
    17.       .OnUpdate( OnGenericUpdateCallback, labelC, valueC) );
    18. }
    19.  
    20. // BELOW, SINGLE CALLBACK
    21.  
    22. void OnGenericUpdateCallback( TweenEvent e ) {
    23.    UILabel label = e.params[0];
    24.    int value = e.params[1];// HOW CAN I GET A DYNAMIC VALUE FROM THE TWEEN?
    25.    label.text = value.ToString();
    26. }
    27.  

    I hope that makes sense. Thanks!
     
  2. cupsster

    cupsster

    Joined:
    Apr 14, 2009
    Posts:
    363
    Hello I have this error in my code constantly popping up. What can be wrong?

    NullReferenceException: Object reference not set to an instance of an object
    Holoville.HOTween.Plugins.Core.ABSTweenPlugin.SetUndefinedValue (System.Object p_value) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__HOTween.Assembly/HOTweenV1/Plugins/Core/ABSTweenPlugin.cs:693)
    Holoville.HOTween.Plugins.Core.ABSTweenPlugin.SetValue (Color p_value) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__HOTween.Assembly/HOTweenV1/Plugins/Core/ABSTweenPlugin.cs:618)
    Holoville.HOTween.Plugins.PlugSetColor.DoUpdate (Single p_totElapsed) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__HOTween.Assembly/HOTweenV1/Plugins/PlugSetColor.cs:250)
    Holoville.HOTween.Plugins.Core.ABSTweenPlugin.Update (Single p_totElapsed) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__HOTween.Assembly/HOTweenV1/Plugins/Core/ABSTweenPlugin.cs:469)
    Holoville.HOTween.Tweener.Update (Single p_shortElapsed, Boolean p_forceUpdate, Boolean p_isStartupIteration, Boolean p_ignoreCallbacks, Boolean p_ignoreDelay) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__HOTween.Assembly/HOTweenV1/Tweener.cs:844)
    Holoville.HOTween.Tweener.Update (Single p_shortElapsed, Boolean p_forceUpdate, Boolean p_isStartupIteration, Boolean p_ignoreCallbacks) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__HOTween.Assembly/HOTweenV1/Tweener.cs:710)
    Holoville.HOTween.Core.ABSTweenComponent.Update (Single p_elapsed, Boolean p_forceUpdate, Boolean p_isStartupIteration) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__HOTween.Assembly/HOTweenV1/Core/ABSTweenComponent.cs:994)
    Holoville.HOTween.Sequence.TweenStartupIteration () (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__HOTween.Assembly/HOTweenV1/Sequence.cs:880)
    Holoville.HOTween.Sequence.Startup () (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__HOTween.Assembly/HOTweenV1/Sequence.cs:911)
    Holoville.HOTween.Sequence.Update (Single p_shortElapsed, Boolean p_forceUpdate, Boolean p_isStartupIteration, Boolean p_ignoreCallbacks) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__HOTween.Assembly/HOTweenV1/Sequence.cs:649)
    Holoville.HOTween.Core.ABSTweenComponent.Update (Single p_elapsed) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__HOTween.Assembly/HOTweenV1/Core/ABSTweenComponent.cs:954)
    Holoville.HOTween.HOTween.DoUpdate (UpdateType p_updateType, Single p_elapsed) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__HOTween.Assembly/HOTweenV1/HOTween.cs:2252)
    Holoville.HOTween.HOTween.Update () (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__HOTween.Assembly/HOTweenV1/HOTween.cs:734)
     
  3. woshihuo12

    woshihuo12

    Joined:
    Jul 18, 2014
    Posts:
    36
    when i use for ngui like this:
    HOTween.To(mStars.gameObject.transform, 0.25f, new TweenParms().Prop("localRotation", new Vector3(0, 0, 720)));
    i want rotate the ui two circle....
    but the ui still there,cant rotate..
     
  4. latas

    latas

    Joined:
    Oct 9, 2013
    Posts:
    149
    Hi everyone, I'm not able to build my project using Unity 3D 4.5.2f with the current latest hotween.dll 1.3.550 for Windows 8.1 Store platform. It reports 3 errors concerning to several functions not existant in the framework:

    Reference Rewriter: Error: method `System.Reflection.MethodInfo System.Reflection.PropertyInfo::GetGetMethod()` doesn't exist in target framework. It is referenced from HOTween.dll at System.Object Holoville.HOTween.Plugins.Core.ABSTweenPlugin::GetValue().

    UnityEngine.Debug:LogError(Object)
    PostProcessMetroPlayer:RunReferenceRewriter(MetroSDK, String, String, String, String) (at C:/BuildAgent/work/d63dfc6385190b60/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessMetroPlayer.cs:438)
    PostProcessMetroPlayer:postProcessSDKSpecific(MetroSDK, BuildTarget, BuildOptions, String, String, ProjectImages) (at C:/BuildAgent/work/d63dfc6385190b60/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessMetroPlayer.cs:806)
    PostProcessMetroPlayer:postProcess(BuildTarget, BuildOptions, String, String, String, String) (at C:/BuildAgent/work/d63dfc6385190b60/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessMetroPlayer.cs:636)
    UnityEditor.HostView:OnGUI()


    Second One:

    Reference Rewriter: Error: method `System.Reflection.PropertyInfo System.Type::GetProperty(System.String)` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void Holoville.HOTween.TweenParms::InitializeObject(Holoville.HOTween.Tweener,System.Object).

    UnityEngine.Debug:LogError(Object)
    PostProcessMetroPlayer:RunReferenceRewriter(MetroSDK, String, String, String, String) (at C:/BuildAgent/work/d63dfc6385190b60/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessMetroPlayer.cs:438)
    PostProcessMetroPlayer:postProcessSDKSpecific(MetroSDK, BuildTarget, BuildOptions, String, String, ProjectImages) (at C:/BuildAgent/work/d63dfc6385190b60/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessMetroPlayer.cs:806)
    PostProcessMetroPlayer:postProcess(BuildTarget, BuildOptions, String, String, String, String) (at C:/BuildAgent/work/d63dfc6385190b60/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessMetroPlayer.cs:636)
    UnityEditor.HostView:OnGUI()


    And the last one:

    Reference Rewriter: Error: method `System.Reflection.FieldInfo System.Type::GetField(System.String)` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void Holoville.HOTween.TweenParms::InitializeObject(Holoville.HOTween.Tweener,System.Object).

    UnityEngine.Debug:LogError(Object)
    PostProcessMetroPlayer:RunReferenceRewriter(MetroSDK, String, String, String, String) (at C:/BuildAgent/work/d63dfc6385190b60/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessMetroPlayer.cs:438)
    PostProcessMetroPlayer:postProcessSDKSpecific(MetroSDK, BuildTarget, BuildOptions, String, String, ProjectImages) (at C:/BuildAgent/work/d63dfc6385190b60/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessMetroPlayer.cs:806)
    PostProcessMetroPlayer:postProcess(BuildTarget, BuildOptions, String, String, String, String) (at C:/BuildAgent/work/d63dfc6385190b60/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessMetroPlayer.cs:636)
    UnityEditor.HostView:OnGUI()
     
  5. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @dixitalgorismi The stutter is because you're using FixedUpdate, which is not tied to the framerate, so everything moving there stutters (not due to HOTween, but to how Unity works). I'd suggest you use regulat Update instead. About the fact that it moves faster, it might possibly be due to the fact that, when you record something at 0.1", you're not really at 0.1", but at a time which is between 0.1" and the next update, while HOTween will use 0.1 precisely and thus appear to move faster. You should record also the actual time when this happens, which will be like 0.1x depending on your framerate, and use that for HOTween's duration.

    @aholla Oh I see. I'm afraid you can't get the dynamic value from a tween (because a single tween could be tweening more than one thing, and of completely different types), but you could still do something like this:
    Code (csharp):
    1.  
    2. void OnGenericUpdateCallback( TweenEvent e ) {
    3.   UILabel label = (UILabel)e.params[0];
    4.   if (label == labelA) labelA.text = valueA.ToString();
    5.   else if (label == labelB) labelB.text = valueB.ToString();
    6.   else labelC.text = valueC.ToString();
    7. }
    8.  
    @cupsster That means that the target of that tween is null and thus invalid

    @woshihuo12 a 720 rotation equals to 0 in Unity measures. Make it relative to allow HOTween to "go beyond 360":
    Code (csharp):
    1.  
    2. HOTween.To(mStars.gameObject.transform, 0.25f, new TweenParms().Prop("localRotation", new Vector3(0, 0, 720), true));
    3.  
    @latas See my answer on Google Code. Apparently you need to update Visual Studio to the latest version (or just install the latest free version of VS Express). That will upgrade your NET framework and make everything work (even if you will get some errors when building, but things will work anyway). This is a temporary solution until Unity reimplements some methods that were working up to 4.3 (and for which there is no other solution right now, when building for WP8/Store)
     
  6. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Beware. Talking more with @latas it appears that Windows Store builds won't work with HOTween (neither Micro nor regular) with Unity 4.5.2 (everything works instead at least up to Unity 4.3.4).

    In the meantime I'm pushing Unity for a bugfix (since it's an internal change that broke all Reflection on Windows Store).
     
  7. woshihuo12

    woshihuo12

    Joined:
    Jul 18, 2014
    Posts:
    36
    1. HOTween.To(mStars.gameObject.transform, 0.25f, new TweenParms().Prop("localRotation", new Vector3(0, 0, 720), true));

    1. thanks lzitmee.........

    1. it works!!!!
     
  8. Victor_Kallai

    Victor_Kallai

    Joined:
    Mar 5, 2014
    Posts:
    123
    I want to tween an object to a specific position, but i want the target to change during the animation, and the object to follow. How can one do that? Is it possible?
     
  9. Demigiant

    Demigiant

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

    @Victor_Kallai sorry but no, it's not possible (though it will be possible in DOTween ;)). You'll have to recreate the tween each time
     
  10. Victor_Kallai

    Victor_Kallai

    Joined:
    Mar 5, 2014
    Posts:
    123
    Thanks for the fast reply! So when is DOTween scheduled to be launched? Did you start working on it?
     
  11. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    About the previous Windows Store warning: it's FIXED (in Unity 4.5.3, but in the meantime you can get the latest Unity patch with the fix already implemented here) :)
     
  12. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @Victor_Kallai I've kind of finished DOTween and am working on optimizations. Today I just managed to make it 4.4X faster than HOTween (and without any GC allocation whatsoever) :) Will probably release a beta the end of next week.
    EDIT: though don't wait for the end of next week if you need it to start working on something! I worked a LOT on it in the last three weeks, but I might get stuck in other stuff and push the beta back a little.
     
  13. woshihuo12

    woshihuo12

    Joined:
    Jul 18, 2014
    Posts:
    36
    so good..i can't wait it..so, it's free for use????;);)
     
  14. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Yes it will be free and open source as HOTween, but I plan to make some bonus plugins and examples available as extras for a little money. Some very good Unity friends convinced me it's the right thing to do (also considering that with HOTween I spent a huge amount of time working on features that I personally never used) :)
     
  15. woshihuo12

    woshihuo12

    Joined:
    Jul 18, 2014
    Posts:
    36
    Hotween is so good..i read some replies about hotween, some said the hotween has some problem with wp8 platform??
    So how the hotween's "Cross platform"? can work with all platform?
     
  16. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Glad you like it :) There was a recent issue with HOTween and Windows Store (not WP8), which was actually caused by a bug in Unity. Unity now solved it with this patch (which will be introduced in the next update). Other than that, you just have to remember to use HOTweenMicro (still free and downloadable from the website) instead than HOTween when compiling for Windows Store, WP8, and iOS with max stripping level.
     
  17. gringo2012

    gringo2012

    Joined:
    Jul 6, 2012
    Posts:
    46
    @Izitmee - Thanks for the path Length addition. Works just superb so far.
     
  18. latas

    latas

    Joined:
    Oct 9, 2013
    Posts:
    149
    I can confirm patch referenced above 4.5.2p1 fixes the issue when building for Windows Store Apps (WSA). Thank you very much.
     
  19. woshihuo12

    woshihuo12

    Joined:
    Jul 18, 2014
    Posts:
    36
    The DOTween's API is the same with HoTween? so i can move from hotween to dotween( because dotween is better HaHaHa:p) very easily.....
     
  20. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Actually no (though I definitely would recommend moving to DOTween when it's time: I'm totally doing it already :p). I initially wanted to keep an identical API to make the switch smoother, but then I realized I could achieve a lot more with a different one, also considering that I'm doing DOTween completely from scratch. So the API is just similar, but no more TweenParms (there is direct chaining instead) nor strings, and some control method names have changed to make them more clear (like Reverse, which is instead Flip).
     
  21. dixitalgorismi

    dixitalgorismi

    Joined:
    Aug 6, 2013
    Posts:
    30
    @Izitmee Hey, thanks so much. I already figured that fixedUpdate was the wrong approach, but Update and LateUpdate also didn't solve the problem. I'm now using the FixedUpdate function to just sample the position at an interval and saving the cumulated deltatime for the segment like you suggested. If I'm feeding this into the HOTween sequence everything works like a charm. Thanks you so much man for helping me out and giving us this superbe piece of software for free!
     
  22. hexdump

    hexdump

    Joined:
    Dec 29, 2008
    Posts:
    443
    Oh, I see. Take it easy man, no reason to be embarrassed. We are just humans :).

    So, I should be going to the end of the ween instead of the start?

    Thanks in advance.
     
  23. Mr_Cad

    Mr_Cad

    Joined:
    Dec 7, 2013
    Posts:
    27
    Hi, I noticed a problem where I call the Shake method multiple times within a short period then the position of my object will get offset and eventually it might moves out of the screen.

    For example, whenever OnClick events happen, then I'll call HOTween.Shake, if the user press multiple times then HOTween.Shake will be called multiple times as well. Even though the object has been shaken for multiple times but I'm expecting it to be returned to its original position but it doesn't.

    How should I use the HOTween.Shake method so that I can assure every time after the Shake's tween ends, the object will always return to its original position?

    Here's my codes:
    Code (CSharp):
    1. HOTween.Shake(transform, shakeDuration, "localPosition", shakePos, shakeAmplitude, shakePeriod);
     
  24. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Yey, more simplicity! :D
    Can't wait for DOTween!

    EDIT:

    Just out of curiosity, is it (DOTween) faster than LeanTween?
     
  25. ARTsev

    ARTsev

    Joined:
    Jul 23, 2014
    Posts:
    4
    hi all

    I have a gun, which should rotate the barrel in the direction of the enemy, I made based on Quaterniun.Slerp () but this approach I do not like the fact that the animation curve is not linear! (i.e. animation begins smoothly accelerating in the center and gradually stops in the end). How can I use opportunities to HOTween linearly (at the same speed), turn the gun in the direction of the enemy, provided that the enemy is constantly moving?
     
  26. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @dixitalgorismi Great you solved it, and thanks for the thanks :)

    @hexdump Yes, if you Complete the tween you will go to the exact starting position

    @Mr_Cad Each time you start a tween, the current position of the tweened object is taken as the starting point. So if you start a new tween on something being shaken, the current "shake position" will become the starting point, and thus the object will move. I would recommend to simply store your tween in a variable, and than call myTween.Complete() before creating a new Shake.
    [/CODE]

    @BTStone Simplicity for the win! :) To be honest, I wasn't expecting the final version of DOTween to be faster than LeanTween: LeanTween is a well made engine, and since DOTween has more features and is more flexible it should in theory be slower. But I'm optimizing a lot, and from the current tests (with all DOTween's options already implemented) DOTween is slightly faster than LeanTween when playing tweens, while LeanTween is slightly faster than DOTween when creating them (but I'm still working on optimizations, so who knows) :) Still, both are good, since we're talking about minimal values, so it mostly depends on a question of taste (as with HOTween and iTween, DOTween is an object-oriented engine, while LeanTween is a UnityObject-oriented one) and features.
    Here we go with some stats, based on my stress-test project:

    Looping 32,000 floats:
    • DOTween = 225 FPS (36 milliseconds to start them up)
    • LeanTween = 209 FPS (29 milliseconds to start them up)
    • GoKit = 123 FPS (8872 milliseconds to start them up)
    • HOTween = 55 FPS (221 milliseconds to start them up)
    • iTween = crashes when trying to loop more than 2,000 (and with 2,000 stays at 3 FPS)
    Looping 1,000 transforms positions:
    • DOTween = 298 FPS (0.8 milliseconds to start them up)
    • LeanTween = 292 FPS (0.6 milliseconds to start them up)
    • GoKit = 281 FPS (14 milliseconds to start them up)
    • HOTween = 279 FPS (5 milliseconds to start them up)
    • iTween = 166 FPS (50 milliseconds to start them up)

    @ARTsev Sorry but a tween engine is definitely not recommended for something that's constantly moving, because you would need to create a new tween each time the target changes.
     
  27. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Some sick optimisations going on here! Great!
    Not that I ever had to complain about HOTween-Performance, though...but hey! Improvement is always welcome :p
     
  28. pateras

    pateras

    Joined:
    Jan 12, 2013
    Posts:
    50
    Hi. First, thank you for this amazing library. I've used it in several projects now, and have very much enjoyed doing so.

    I have a quick question. I'd like to have the end value of the property be constantly re-evaluated:

    Code (csharp):
    1. parms.Prop("position", GetPosition(target));
    If I do that, GetPosition is called only once. I'd like it to be called frequently as the Tween runs, so that the value is updated appropriately. Effectively, I want to chase an object as it moves.

    Is this possible?

    Thank you.
     
  29. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @BTStone Improvements improvements! This evening I just decided to scrap a big part of DOTween's inner engine to use a different logic and make it even faster (both while playing than at startup). We'll see how it goes :p

    @pateras Glad you like it :) And sorry but no, you can't change the end value after the tween has started, and you will have instead to recreate a new one (the upcoming DOTween will allow that instead).
     
  30. pateras

    pateras

    Joined:
    Jan 12, 2013
    Posts:
    50
    Thanks for the fast response.

    What will the feature look like in DOTween? Will I save a reference to the Tweener and tell it to update its value? And any updates on the beta date? If that feature is available, I might be able to wait a bit.

    Thanks again!
     
  31. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    When I call a tween with the PlugVector3Path the tween works the first time it is played but if I recycle the tween and call it again I get this error:
    Do you have idea what would cause this?
    My code looks like this:
    Code (csharp):
    1. public Vector3 CameraMovementPosition
    2. {
    3.      get{return transform.position;}
    4.      set{transform.position = value;}
    5. }
    6.  
    7. protected void Start()
    8. {
    9.      InitializeTargetPointTween();
    10. }
    11.  
    12. protected void InitializeTargetPointTween()
    13. {
    14.      parmsTargetPoint = new TweenParms();
    15.      parmsTargetPoint.UpdateType(UpdateType.LateUpdate);
    16.      parmsTargetPoint.Ease(EaseType.Linear);
    17. }
    18.  
    19. public void TweenCameraToPoints(Vector3 []points, float tweenTime = 1.0f)
    20. {
    21.      if(parmsTargetPoint != null && (targetPointTween == null || (targetPointTween != null && targetPointTween.isComplete)))
    22.      {
    23.           parmsTargetPoint.Prop("CameraMovementPosition", new PlugVector3Path(points, PathType.Curved).Is2D(true));
    24.           targetPointTween = HOTween.To(this, tweenTime, parmsTargetPoint);
    25.      }
    26. }
    27.  
    EDIT:
    I'm using HOTweenMicro v1.3.350.
    Also, I saw a similar issue in this same forum, but I'm not sure if that's the problem. It said this:
    EDIT 2:
    I have 2 separate gameobjects that call my code on collision. When I collide with the first gameobject the tween works correctly. Then when I move on and collide with the second gameobject I get the error again. This make me believe there's some weird behavior going on with the PlugVector3Path not being referenced correctly in the dll.

    EDIT 3:
    I was able to fix the problem, but it was not ideal. Before I create the tween I create a new TweenParms every time. Before I was using the TweenParms like I do everywhere else in my code where on Start I create the TweenParm. Then I recycle the TweenParms, so I'm not recreating it everytime I call the tween.
     
    Last edited: Jul 25, 2014
  32. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @pateras Yes you will be able to call a "ChangeEndValue" method directly from a Tweener. About beta release, I had it ready since 3 days, but yesterday evening I decide to scrap part of its architecture because I found a way to make it faster. So probably for the end of next week. But don't count too much of it, because I might decide to work more on it.

    @Ben BearFish Glad you fixed it in the meantime. The issue there is that the PlugVector3Path you store in a TweenParm is passed as a reference and then modified, so it is not valid to be passed later. It should work if you just pass a new PlugVector3Path using myTweenParms.NewProp, which deletes any Props set previously.
     
  33. DavidDebnar

    DavidDebnar

    Joined:
    Mar 19, 2011
    Posts:
    115
    Hello! A quick question this time, is there a way to clean all the 'null' tweens and sequences? I instantiate/destroy a lot of objects and that causes a lot of unused sequences in the background, which I'd like to destroy during loading.

     
  34. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @Dávid Debnár Hello! :) You can kill everything with DOTween.Kill(). But you should also always take care to kill a tween before you destroy their targets. Another possible reason why those sequences are null is because you created them but never placed Tweeners inside?
     
  35. DavidDebnar

    DavidDebnar

    Joined:
    Mar 19, 2011
    Posts:
    115
    I'm pretty sure there are tweens inside; and I didn't want to use HOTween.Kill (), because that would ruin my existing tweens :p. I ended up placing a sequence.Kill () inside OnDestroy and that seems to have worked perfectly. Thanks anyway :)
     
  36. BAnyBudde

    BAnyBudde

    Joined:
    Jun 3, 2014
    Posts:
    51
    First of all, this Tweening software is Amazing, I'm using it with Vevusio's Visual Path Editor and just WOW!
    The only Hiccup I am having is when I try to export to iOS.
    I have the Hotween Micro Files in my project and no Hotween regular Files, and I have the stripping level set to max on my Export.

    It still gives me this error --------------->

    Assets/Assets/Holoville/HOPath/PathPreview.cs(2,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?

    Any Idea whats going on?
     
  37. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Might I ask where we can access/download DOTween, or has it not been released yet?
     
  38. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    The Unity Editor cannot run on iOS so any code that references the UnityEditor library will not run/compile on iOS. To get it to run on iOS, wrap your UnityEditor code like this:
    Code (csharp):
    1. #if UNITY_EDITOR
    2. using UnityEditor;
    3. #endif
     
    Last edited: Jul 26, 2014
  39. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Is it possible to tell the PlugVector3Path in the tween to tween between each point instead of do an entire tween over the whole path, so that the tween can ease in and out between each point on the path?

    Currently, the only way I can see doing this is to create a separate tween between each point and on complete call the next tween.
     
  40. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @Ben BearFish I'm still working on DOTween, changing the API etc, so I decided to postpone the beta release to the end of next week (probably).
    About PlugVector3Path, there is a hidden Tweener method (UsePartialPath) that allows to do what you want. But beware, I didn't write it in the official documentation because it might be tricky to use, and it's there to allow @Baroni Simple Waypoint System to access it. So you could try using it, but if you have issues you might try SWS directly.
     
  41. DavidDebnar

    DavidDebnar

    Joined:
    Mar 19, 2011
    Posts:
    115
    I completely missed the talk about DOTween (HOTween Dos? ;)) and thought it was a typo :oops:. I can't wait! Dynamic targets sound amazing! Are you working on an visual editor too :rolleyes:, or should I just port Motion (my HOTween visual editor) when the time comes? :)
     
  42. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    I can't wait either! Working a LOT on it right now (it looked finished, but then I decided to try new stuff) :) For now, I don't plan to make a visual editor for it (I ended up never using HOTween's visual editor, and just spent a lot of time supporting it). So Motion will be very welcome ;)
     
  43. DavidDebnar

    DavidDebnar

    Joined:
    Mar 19, 2011
    Posts:
    115
    @Izitmee If you don't mind me asking, does DOTween support dynamic 'from' values? Lets say I want a tweener to always tween a cube's localScale to (1, 1, 1), but from different sizes. With HOTween, I always had to reinitialize the tweener for a smooth animation to happen, or else it would tween from the original localScale towards the target.
    Secondly, and lastly, what about speed? If, what I just described, was possible, I'd love a speed setting instead of a duration, to keep the animations nicely unified :).
     
    Last edited: Jul 27, 2014
  44. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Just added "dynamic FROM tween" to my todos! And about speed settings, I added that too (by the way, you know that HOTween already has a SpeedBased option, right? :))
     
  45. DavidDebnar

    DavidDebnar

    Joined:
    Mar 19, 2011
    Posts:
    115
    Brilliant and amazing! Yes, I've been aware, but you can't use neither easing nor sequences with it, which outweighed it's usefulness for me.
    Either way, it seems like I'll have to allocate a decent time period just to go nuts with the new code-candy :)!
     
  46. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    If you want ease with SpeedBased sooner, I think I can implement it pretty easily in HOTween too. Let me know :)
     
  47. DavidDebnar

    DavidDebnar

    Joined:
    Mar 19, 2011
    Posts:
    115
    Ah, a great offer, but I'll be happier if you invest that time into making DOTween even more killer. :)
     
  48. BAnyBudde

    BAnyBudde

    Joined:
    Jun 3, 2014
    Posts:
    51
    @BenBearFish

    The Unity Editor cannot run on iOS so any code that references the UnityEditor library will not run/compile on iOS. To get it to run on iOS, wrap your UnityEditor code.

    The When I try to open the path preview script, which is where that error lies, it will just not open in mono develop for me to edit? Any ideas?
     
  49. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @BAnyBudde Just open PathPreview.cs directly - sorry for not fixing the problem at the source but I don't manage HOPath, since it's done by @Vevusio :)
     
  50. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @Dávid Debnár Just thought I'd drop the fact that this evening I just finished implementing both SpeedBased tweens (ease included) than ways to change start values, end values and duration while a tween is running (and which take into account if a tween is speedBased) in DOTween. Also, changing the start value is like changing a tween's FROM position, so that's done too :)