Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

HOTween: a fast and powerful Unity tween engine

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

  1. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Ok, I think I got it now, sorry for the confusion.

    It's not a quick thing to do, since I would need to add a custom inspector (though mostly a clone of the current visual editor) for the HOTweenInstance component. I'll be kind of busy in the next couple days, since tomorrow I'm travelling too (going back from Serbia to Rome - sigh, but I'll get to Serbia again in a couple weeks :p) and will have to take care of some bureaucratic stuff. In the meantime I'll think about the best possible way to do it (and check out Sandro's project, in case I get it - but tell him he can spare the time, since I should have understood it all), and let you know after this weekend :)
     
  2. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Thanks again Daniele, I've forwarded your reply to Sandro. Meanwhile, let me wish us both a nice trip, I'm about to go to the airport :) I'll be checking back on the forums and e-mails, just a tad slower. Have fun!
     
  3. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Hey Breno, sorry for being late. When I came back to Rome I found a bureaucratic hell to fix, which took almost all of my time (not to mention that my faithful internet connection was totally dead). Hope you had a better trip :)

    I thought about how I could do it, and Sandro's advice is definitely the best option. I'll still be quite busy until next thursday, and then I'll try to see if what I have in mind will work. I hope you didn't need this too quickly :p
     
  4. SilentWarrior

    SilentWarrior

    Joined:
    Aug 3, 2010
    Posts:
    107
    Hello Izitmee, long time I didnt post anything :D been busy with school, now back working on my game.

    Just to let you know that I used HOTween to tweak the values of the volume and pitch for several sounds for my tank to simulate speeding up, braking, turning, idle, turning on and off, etc, it works fantastically :D and was surprisingly fast to make. I even replaced some extra sounds i had because the pitch tweaking with hotween animations worked so much better, way more smooth transitions too.
     
  5. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    That just made me shamelessly proud, thanks :D By the way, I'm getting more and more curious about your game. Do you have a work-in-progress thread about it?
     
  6. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Well.. suffice to say that when I finally got home, I fell down sick lol :D Slowly recovering now.

    Not really, it's mostly urgent for video tuts and that GUI sample using RageTools + HOTween (I got plenty of requests on those). BTW, I've talked to Alex Chouls (Playmaker dev) about it and he said he's interested on having HOTween actions, these visual editor changes would come in quite handy for setting those actions up.

    PS.: Since you're quite interested in games done using HOTween, you'll be glad to know that a mid-sized studio here in Brazil, Monster Juice, uses HOTween primarily for its games. Plenty of "juicy" stuff in there, check it out :) http://www.monsterjuice.com.br/games
     
  7. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    Is it me or the HOTween Editor zip doesn't contains a package? It contains folders with what I believe to be assets meta informations, but not a .unitypackage, so I am a bit lost on how I should install the visual editor...

    Hopefully this is just me :)

    bye,

    Jean
     
  8. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @MaDDoX: I'll start working on it tomorrow, and hopefully have it ready for this weekend :) And thanks for that studio link: they look really nice, and what an awesome logo!

    @jeanfabre: sorry, I made the ZIP on Windows, and I tend to forget that Mac has the bad habit of unzipping both the ZIP and the UnityPackage at the same time. You can re-download a fixed version from HOTween's website, or just download the unzipped UnityPackage from HOTween's Google Code page.
     
  9. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Excellent news Izitmee, eagerly looking forward to it - you have no idea what demo I'm gonna do when this is set in place, lemme just say it's gonna be wild ;) And I'll pass your compliments to Bruno, Rodrigo and the rest of the Monster Juice team, I'm sure they'll be pleased.
     
  10. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Damn I'm so curious about that demo now! Will definitely try to finish it for the weekend.

    I also decided the editor needs a recoding, because:
    - I'm a way better C# coder now, plus when I did it I rushed it thus its code is a mess :p
    - I need some code to be re-usable both by the current Editor than by the "HOTween Component" Inspector

    Since I'm recoding it, I'm also trying to create a better and more usable UI, since the current one is messy. Any suggestions (both usability and feature-wise) while I'm at it? :) Consider also that the new Editor/Inspector will be a DLL (actually, 2 DLLs - though I will put the source on Google Code as usual), because it allows for a much better coding.
     
  11. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    New update: HOTween v1.1.007
    Implemented HOTweenInspector. Now, when inside Unity's Editor and while in runtime, clicking on HOTween's instance will show a panel with a series of debug informations for all existing tweens (running/paused/delayed/disabled). Apart various infos and buttons, clicking on a tweened target name will select its eventual GameObject. Here is a screenshot (showing both pro and indie user interface):

    $hotweenInspector.gif

    Consider that, while showing these infos, your framerate will obviously drop. Thus select HOTween's instance only when you need to see more informations, and not when profiling.

    @MaDDoX: I lost some time on this update, but I still hope to finish the additions to HOTween's Visual Editor for tomorrow (and in the end I'm not recoding it as a DLL: that was a stupid idea - it's too hot here :p)
     
    Last edited: Jul 7, 2012
  12. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    These are cool improvements Izitmee, congratz :) Now you got me befuddled.. how exactly does compiling to DLL increase your room's temperature?? :confused: (j/k) :D
     
  13. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Lol, thinking of it, compiling to DLL DOES increase my room's temperature. Later when coding in Unity I use Sublime Text, but when DLL-ing I use Visual Studio, which overheates my computer and causes a lot of hot air to be blown around :D
     
  14. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Whew! It's night here but I'm finally done :)

    New update: HOTween Visual Editor v1.0.001
    - Integrates with tweens created with previous versions of the Visual Editor without breaking anything.
    - Added HOTweenComponent. Works like the regular Visual Editor panel, but is attached to GameObjects (via the Component > HOTween > HOTweenComponent menu item). Does exactly what Breno (MaDDoX) was asking for, and works perfectly with prefabs and spawning. Note that you have an additional checkbox (right under the version, checked by default) which allows to destroy HOTweenComponent after the tweens have been created.
    - Added icons for HOTweenManager and HOTweenComponent.
    - HOTween Visual Editor menu item is now directly under the Windows menu (instead than Windows > Holoville).
    - Various optimizations.

    Even if I tested it, please backup your project before updating, in case some bug escaped me. And let me know if you have any issues.

    As usual, you can get it from HOTween's website.
    Remember that you also need to add HOTween to your project.

    @MaDDoX: ah! Now I can't wait to see that wild demo :)
     
    Last edited: Jul 8, 2012
  15. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Hey :) Baroni (Mr. Simple Waypoint System) convinced me to finally work on the implementation of partial tweens as the next HOTween step. I'll start on Wednesday, but first I have a question: how do you think easing should behave?

    Crop mode
    It behaves as if the end value is still the original one, and it simply interrupts (or restarts/rewinds, depending on the chosen options) when the value reaches the chosen partial.

    Shrink mode
    It re-adapts itself to the new partial tween, meaning it will behave as if the end value is not the original one but instead the new partial one.

    Personally, both Baroni and me would go for the Shrink mode. But I wanted to be sure if someone had something against it, and why :)
     
  16. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Me too lol :D Gotta start work on that tomorrow for sure! Today I gotta play with the visual editor changes, learn its in-and-outs and test it in our WIP game - it's fun time heh.

    Thanks for your great work Izitmee, huge boost for the whole community! ^_^

    PS.: As for partial tweens, I'm not 100% sure what's the difference between the shrink mode and a sped-up / slowed-down tween?
     
  17. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    I started making a graph to explain better, and then I realized that the "crop mode" makes no sense :p Let me explain how it will work (and how shrink mode differs from speeding up the tween).

    Let's say we're tweening a float SampleFloat from 0 to 50, using an EaseOutQuad easing, and a duration of 5 seconds.

    Regular tween
    During 5 seconds, SampleFloat value will change from 0 to 50.
    Since we're using an EaseOut easing, when the tween reaches 2.5 seconds SampleFloat value will be around 18 (and not 25, as with a linear easing).

    Regular sped-up tween
    As the regular tween, but the duration will change according to the new timeScale. SampleFloat value will still change from 0 to 50.
    When the tween reaches the half of its duration, SampleFloat value will still be around 18.

    Partial tween with "shrink-mode easing"
    If for example we set the "partial" property of the original tween to 0%-50%, the duration will now be 2.5 seconds, and SampleFloat will only change from 0 to 25.
    The "movement" of SampleFloat though, won't be exactly as it was before, since the easing will be shrinked to re-adapt to the new endValue (which is now 25). This means that, after 2.5 seconds, SampleFloat value will be exactly 25 (instead than 18 as in the regular tween).

    Uh, I hope this was clear enough. Otherwise sorry: I'll blame the heat as usual :D

    P.S. thanks to you for the boost, Breno :)
     
  18. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    I think I got it. If the easing was linear there wouldn't be a change from simply interrupting the tween mid-way. Curiously, the technique you describe sounds more like "cropping" than "shrinking", since you're cropping one of the graph axis (the value one in this case)... at least that's what it sounds to me, if what I just said makes no sense, blame the cold that's freezing ma brainz ;)

    In that sense yeah, having a partial "shrink" for a tween (or cropping as you call it.. man, this is confusing) makes no sense since you can simply slow it down at will and the easing will already adjust accordingly.
     
  19. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Wow, Baroni (Mr Simple Waypoint System) just made an awesome donation, and I feel very hyped! Tomorrow I'll definitely start pushing on the creation of partial tweens, and they will surely be ready for the weekend :)

    Thanks Baroni (bowing, bowing), from me and from HOTween :)
     
  20. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,168
    Haha, I guess that's my time in the spotlight ;) Thanks to you and your work!
     
  21. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Hey Izitmee, finally tested the new version (I know, I'm late) and it's a perl! Cloning objects with one-shot tweens now work perfectly, and the new "Destroy After Setup" is just what the doctor ordered for both prefab and prototype instantiation. Simply genius! It seems I'll truly have to join the owe-you-beer-money train :) For the record, the visual editor version that's in your web site gave me a small compile error:
    Code (csharp):
    1. Assets/Holoville/HOTween Extensions/HOTweenManager/HOTweenManager.cs(72,49): error CS0029: Cannot implicitly convert type `Holoville.HOTween.Tweener' to `Tweener'
    Which I've managed to fix. On line 53, I've simply changed the return type accordingly:
    Code (csharp):
    1. public static Holoville.HOTween.Tweener CreateTween(HOTweenData p_twData, float p_globalDelay, float p_globalTimeScale)
    I wasn't sure if it'd crash somewhere else but it didn't, and after a couple tests it seemed stable. Once again, congratz for this quantum leap in tweening productivity, I'll never ever have to set up a tween through code again! ^_^

    PS.: As soon as the "tentacle" demo is out I'll start working on that demo I promised, the.. "Time Tunnel GUI" demo ;)
     
  22. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @Baroni: triple spotlights for you, man! ;)

    @MaDDoX: I wonder why that happened. Do you have a class also called Tweener somewhere in your project?

    Anyway, I implemented your fix and made a new release :)

    New Update: HOTween Visual Editor v1.0.002
    - Fixes eventual "Cannot implicitly convert type `Holoville.HOTween.Tweener' to `Tweener'" issues

    That said, I'm very glad you're liking it, and I'm very curious about the Time Tunnel GUI demo - now that's a cool and mysterious name. Though my heart is weeping knowing I pushed you away from coded tweens :D
     
  23. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Hmm.. as far as I know Sandro removed iTween completely, if he left some leftover that could be the culprit. Still could occur to some people porting over from iTween, supposing that was the culprit, so it's good to have this doubt out of the way :)

    Legions of artists worldwide will worship you and your heart weeps? wow! :D
    This is also a huge addition for Playmaker actions, since it can simply hold the action you want (play, rewind, etc) and optionally a tag - instead of having to replicate all the parameters like it does for iTween. Clean and simple, as it should be.
     
  24. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Ah! Ok, that made my heart stop weeping - and thanks for that: I couldn't sleep with all the sobbing coming from it :D

    On a side note, while working on the partial tween system (which has become focused on waypoints), I just happened to make PlugVector3Path tweens a little faster: I love when stuff like that happens :)
     
  25. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,168
    Double thumbs up on this one :D
     
  26. bngames

    bngames

    Joined:
    Jul 3, 2012
    Posts:
    67
    Hi

    Just followed the Installation and get the error below:


    FileNotFoundException: Could not load file or assembly 'HOTween, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    UnityEngine.InternalStaticBatchingUtility.Combine (UnityEngine.GameObject[] gos, UnityEngine.GameObject staticBatchRoot, Boolean generateTriangleStrips)
    UnityEngine.InternalStaticBatchingUtility.Combine (UnityEngine.GameObject staticBatchRoot, Boolean combineOnlyStatic, Boolean generateTriangleStrips)
    UnityEditor.PostprocessScene+UnityBuildPostprocessor.OnPostprocessScene ()
     
  27. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Hi bngames,

    this may happen sometimes when importing DLLs into Unity. Just close your project and re-open it, and everything should be back to normal.
     
  28. bngames

    bngames

    Joined:
    Jul 3, 2012
    Posts:
    67
    no restarted Unity three times no luck :(
     
  29. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Sorry about this. I'm not sure why it's happening. Could you:
    - Try to create a blank project, import HOTween, and see if you still have this issue
    - Try to delete the "Editor" folder that comes with HOTween and see if something changes?
    - Send me a sample project that's causing this issue, so I can see what's happening?

    Also: what version of Unity are you using?
     
  30. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    New update: HOTween v1.1.102
    - Implements the new UsePartialPath and ResetPath methods, which allow to use only a portion of a path instead of all of it
    - Path tweens are slightly faster
    - API docs updated to latest version

    As usual, you can get the latest version from HOTween's website.

    Applying a partial path tween
    First you have to create the regular path tween and store the Tweener object. Then you can call myTweener.UsePartialPath in one of these 4 ways:

    myTween.UsePartialPath(int fromWaypointId, int toWaypointId);
    Creates a partial path between the given waypoint ids, adapting the easing, and "partializing" the duration

    myTween.UsePartialPath(int fromWaypointId, int toWaypointId, float newDuration);
    Same as above, but applies a new duration to the partial tween, instead of auto-calculating the correct partial

    myTween.UsePartialPath(int fromWaypointId, int toWaypointId, EaseType newEaseType);
    Same as the first one, but changes the easing

    myTween.UsePartialPath(int fromWaypointId, int toWaypointId, float newDuration, EaseType newEaseType);
    Same as the first one, but allows to change both duration and easing

    Resetting a "partialled" path
    myTween.ResetPath();

    Additional notes
    - You don't need to reset the path before applying a new partial. Each time you call UsePartialPath, the original data will be used to create it.
    - The waypoints ids are the indexes of the path array you passed to the PlugVector3Path plugin. Consider though that, if the starting position of the tweened object is not the same as the initial waypoint, HOTween will add a new waypoint as a starting position. Plus, if you chose the ClosePath option, HOTween will add another additional point to the end.
    To target the absolute first waypoint, pass -1 as the "from" waypoint id.
    To target the absolute last waypoint, pass -1 as the "to" waypoint id.
    - Also works with speedBased tweens :)

    Thanks again to Baroni, for the additional testing and the decisive boost (ah! just got me Super Meat Boy with his donation: awesome game, but now I need a gamepad :D) - and for being very nice in general :)
     
    Last edited: Jul 13, 2012
  31. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,168
    OSOM! :D

    Incredibly appreciated. Glad I could help you out in any kind :)
     
  32. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Lol, I always feel very autistic when I realize that, after being on the internet since more than 15 years, I still happen on acronyms I have no idea what they mean :D Now, after a quick search, I wonder if OSOM is Awesome or Outer Stripe of Outer Medulla :D
     
  33. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,168
    I meant awesome :D

    Found that on facebook today, posted by a Unity fan boy idiolizing the new DX11 features and thought I have to spread the word :D
     
  34. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Lol, OSOM!!! :)

    New update (kind of)
    I decided to spend the rest of the day on HOTween, and implement some stuff which is waiting since ages.
    So the fist addition is a shamelessly personal one, suggested by Himatako a long time ago (thanks Hima):
    I added a Flattr button to HOTween's website pages (other than the usual Paypal donation button) :)
     
  35. colinday

    colinday

    Joined:
    Jan 9, 2012
    Posts:
    25
    I was in need of a *fast* tweener and before I rolled my own I thought I'd check out the net and that's how I found HOTween. So far I'm really impressed and it's working great for me ... nice work!!!!! I have a couple of errors when I load up my project and play the game though that I wonder if we can get cleared up ... they only seem to occur when using HOTweenMicro and not HOTween.

    On startup in the console is displayed the following 3 items.

    1) Error
    FileNotFoundException: Could not load file or assembly 'HOTween, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    System.MonoCustomAttrs.GetCustomAttributesBase (ICustomAttributeProvider obj, System.Type attributeType)
    System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit)
    System.MonoType.GetCustomAttributes (System.Type attributeType, Boolean inherit)
    UnityEngine.AttributeHelperEngine.CheckIsEditorScript (System.Type klass)

    2) Error
    Failed to load CustomEditor inspected type
    UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)

    3) Info
    Can't load custom inspector HOTweenInspector because the inspected type is null.
    UnityEditor.AssetPreviewUpdater:GenerateAssetPreview(Object, Int32)

    And when I start the game I get the following:

    1) Error
    FileNotFoundException: Could not load file or assembly 'HOTween, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    UnityEngine.InternalStaticBatchingUtility.Combine (UnityEngine.GameObject[] gos, UnityEngine.GameObject staticBatchRoot, Boolean generateTriangleStrips)
    UnityEngine.InternalStaticBatchingUtility.Combine (UnityEngine.GameObject staticBatchRoot, Boolean combineOnlyStatic, Boolean generateTriangleStrips)
    UnityEditor.PostprocessScene+UnityBuildPostprocessor.OnPostprocessScene ()

    ---------------

    I've restarted Unity and all that, but they dont' seem to go away.

    I'm using
    HOTweenMicro 1.1.102 (HOTween doesn't produce these errors)
    OSX 10.7.4
    Unity 3.5.3f3

    Great tools!
     
    Last edited: Jul 14, 2012
  36. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Sorry about this bug colinday :p Seeing you were using HOTweenMicro I realized It was introduced with the new HOTween Inspector. It's fixed (didn't change the version number, because I just had to rebuild the assemblies correctly). Just re-download it and it'll work :)

    For anyone that got HOTweenMicro in the last week, please re-download it to fix the above mentioned bug (reported by bngames and colinday). If you're using the regular HOTween instead there's no need to do it.
     
    Last edited: Jul 14, 2012
  37. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Important update: HOTween v1.1.200

    - Tweens that concern Transforms (position/rotation/scale/path-animation) are now faster on all platforms, and a LOT faster on iOS/Micro (though the API is still the same, don't worry about that :))

    As usual, get the latest version on HOTween's website.
     
  38. shaderbytes

    shaderbytes

    Joined:
    Nov 11, 2010
    Posts:
    900
    you say faster performance for transforms .. I say yes please ;) thanks Izitmee !
     
  39. Dgizusse

    Dgizusse

    Joined:
    Feb 1, 2012
    Posts:
    30
    Would it be possible to add localPosition/localRotation to your optimization for Transforms?

    Thanks!
     
  40. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    You're welcome shaderbytes ;) And Dgizusse, sure: gonna add it immediately (actually, I was dumb not to add it immediately by myself, but today it's 41 degrees here!!! my brain is dead!)
     
  41. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Ok, that was fast :)

    New update: HOTween v1.1.201

    - Now faster performance involves all Transform tweens: position/localPosition/rotation/localRotation/localScale/path-animation

    Latest version on HOTween's website
     
  42. yuewahchan

    yuewahchan

    Joined:
    Jul 2, 2012
    Posts:
    309
    Code (csharp):
    1. Sequence seq = new Sequence(new SequenceParms().OnStart( o => { Debug.Log("Seq:OnStart"); } ).OnComplete( o => { Debug.Log("Seq:OnComplete"); } ) );
    2.        
    3.             Sequence subSeq = new Sequence(
    4.                 new SequenceParms().OnStart( o => { Debug.Log("SubSeq:OnStart");  } )
    5.                                    .OnComplete( o => {
    6.                                                         Debug.Log("SubSeq:OnComplete");
    7.                                                       } )
    8.             );
    9.            
    10.             Tweener t1 = HOTween.To( go.transform, 1.0f,
    11.                 new TweenParms().Prop( "position", new Vector3( 0,0,0 ))
    12.                 .OnStart( o => { Debug.Log( "Tween1:OnStart" ); } )
    13.                 .OnComplete( o => { Debug.Log( "Tween1:OnComplete" ); }) );
    14.            
    15.             subSeq.Append( t1 );
    16.        
    17.  
    18.         seq.Append( subSeq );
    19.         seq.Play();
    Output:
    Tween1:OnStart
    Seq:OnStart
    SubSeq:OnStart
    Tween1:OnComplete
    Tween1:OnComplete
    SubSeq:OnComplete
    Seq:OnComplete

    Expected result of my thought should be:
    Seq:OnStart
    SubSeq:OnStart
    Tween1:OnStart
    Tween1:OnComplete
    SubSeq:OnComplete
    Seq:OnComplete
     
  43. c-Row

    c-Row

    Joined:
    Nov 10, 2009
    Posts:
    827
    Hey Izitmee,

    regarding your suggestion in the SWS thread, I ran into the issue that I can't seem to be able to Reverse() or PlayBackwards() my tween once it's completed. Both methods work fine as long as the original tween is still running. Am I missing something obvious or do I really need to setup two Tweeners rather than one?
     
  44. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @yuewahchan: mhmm that's true. I added it to the issues list and I'll see if I can fix it in the next days.

    @c-Row: Normally when all the loops of a tween/sequence have completed, the tween/sequence is automatically destroyed. You have to set AutoKill to false (...TweenParms().AutoKill(false)), so it will be kept in memory even after completion and you will be able to "scrub" it.
     
  45. c-Row

    c-Row

    Joined:
    Nov 10, 2009
    Posts:
    827
    Yeah, that seems to do the trick. :) Thanks alot, first prototype thingie works fine now.
     
  46. Dgizusse

    Dgizusse

    Joined:
    Feb 1, 2012
    Posts:
    30
    Hi Izitmee,

    With the latest version, whenever I try to tween a value on a transform object that isn't supported by the speed boost, I get an assert every frame. For example, tweening the eulerAngles:
    Code (csharp):
    1. HOTween.To(transform, 1.0f, "eulerAngles", new Vector3(90.0f, 0.0f, 0.0f));
    I get the following assert on the first fame:
    Code (csharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. Holoville.HOTween.Plugins.Core.ABSTweenPlugin.GetValue ()
    3. Holoville.HOTween.Plugins.Core.ABSTweenPlugin.Startup (Boolean p_onlyCalcSpeedBasedDur)
    4. Holoville.HOTween.Plugins.Core.ABSTweenPlugin.Startup ()
    5. Holoville.HOTween.Tweener.Startup (Boolean p_force)
    6. Holoville.HOTween.Tweener.Startup ()
    7. Holoville.HOTween.Tweener.Update (Single p_shortElapsed, Boolean p_forceUpdate, Boolean p_isStartupIteration, Boolean p_ignoreDelay)
    8. Holoville.HOTween.Tweener.Update (Single p_shortElapsed, Boolean p_forceUpdate, Boolean p_isStartupIteration)
    9. Holoville.HOTween.Core.ABSTweenComponent.Update (Single p_elapsed)
    10. Holoville.HOTween.HOTween.DoUpdate (UpdateType p_updateType, Single p_elapsed)
    11. Holoville.HOTween.HOTween.Update ()
    And this every subsequent frames:
    Code (csharp):
    1. InvalidCastException: Cannot cast from source type to destination type.
    2. Holoville.HOTween.Plugins.Core.ABSTweenPlugin.SetValue (System.Object p_value)
    3. Holoville.HOTween.Plugins.Core.PlugVector3.DoUpdate (Single p_totElapsed)
    4. Holoville.HOTween.Plugins.Core.ABSTweenPlugin.Update (Single p_totElapsed)
    5. Holoville.HOTween.Tweener.Update (Single p_shortElapsed, Boolean p_forceUpdate, Boolean p_isStartupIteration, Boolean p_ignoreDelay)
    6. Holoville.HOTween.Tweener.Update (Single p_shortElapsed, Boolean p_forceUpdate, Boolean p_isStartupIteration)
    7. Holoville.HOTween.Core.ABSTweenComponent.Update (Single p_elapsed)
    8. Holoville.HOTween.HOTween.DoUpdate (UpdateType p_updateType, Single p_elapsed)
    9. Holoville.HOTween.HOTween.Update ()
    10.  
    Thanks!
     
  47. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Sorry Dgizusse, that's because I'm an idiot :p Don't know how I missed that - my brain is really overloaded these days. Going to fix it immediately.
     
  48. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    New update: HOTween v1.1.202

    - Fixed bug introduced in v1.1.201, where animating a Transform property not included in the new speed tweens wasn't working

    As usual, you can get the latest version on HOTween's website.

    @Dgizusse: this fixes your issue (again, sorry for that). Just a note though: you don't need to animate the eulerAngles property to actually use Euler angles. You can pass them to the regular rotation property, and HOTween will take care of the conversion while still using the new fast tweens.
    Code (csharp):
    1.  
    2. HOTween.To(transform, 1.0f, "rotation", new Vector3(90.0f, 0.0f, 0.0f));
    3.  
     
  49. Dgizusse

    Dgizusse

    Joined:
    Feb 1, 2012
    Posts:
    30
    Nice, Thanks for the quick fix and the tip!
     
  50. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @c-Row: while making some experiments, I just realized there's a simpler way to animate the timeScale of a single tween/sequence. I forgot that tweens can be tweened too :)
    Instead of using another variable and OnUpdate to update the tween, you can directly animate the timeScale property of the tween. Like:
    Code (csharp):
    1.  
    2. // Create a tween and store it as "myTween".
    3. // Create a tween that will animate myTween's timeScale to 0 and set AutoKill to false so you can "scrub" it.
    4. myTimeScaleTween = HOTween.To(myTween, 1, new TweenParms().Prop("timeScale", 0).AutoKill(false));
    5.