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. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Hey jrricky.

    You can easily do timeScale independent tweens by using the UpdateType.TimeIndependentUpdate, which ignores Unity's timeScale (though you can still set the desired internal timeScale of the tween).

    About iOS, it is fully compatible, though I just had reports about issues when compiling for micro mscorlib. Working on the best solution for that thanks to the help of stfx.
     
  2. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Thanks, just downloaded and testing now and unity throwing this error:
    for this code:
    Code (csharp):
    1. HOTween.To(pauseMenu.transform, 1, "rotation", new Vector3(0,0,-360)).UpdateType(UpdateType.TimeIndependentUpdate);
    Did I type something wrong?

    EDIT: Figured it out using the API, it is TimeScaleIndependent, not just TimeIndependent.
     
    Last edited: Apr 2, 2012
  3. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    One thing I don't understand though is why Hotween sees -360 the same as 0 rotation and doesn't animate because of this...??
     
  4. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Oops, sorry about the typo, going to fix it in the documentation.

    About -360, that happens because rotation is calculated in "Unity" quaternion style. If you try and set the Z rotation of a transform directly on the Transform inspector, you'll see that Unity converts it to 0 as soon as it starts.
    If you want to treat rotations as pure numbers (as is your intention), you should set them as relative. That way, -360 is calculated as truly -360, and you can also set higher rotations like -1670. To do that, just add a ", true" after the "new Vector3(0,0,-360)", which actually sets the tween as relative.

    Also, you can't set UpdateType like that: you have to use TweenParms, like:
    Code (csharp):
    1.  
    2. HOTween.To(pauseMenu.transform, 1, new TweenParms().Prop("rotation", new Vector3(0,0,-360), true).UpdateType(UpdateType.TimeScaleIndependentUpdate));
    3.  
     
    Last edited: Apr 2, 2012
  5. yavadoo

    yavadoo

    Joined:
    Mar 24, 2012
    Posts:
    102
    Hello, I have a little problem with HOTween, maybe someone can help.

    I have a kind of ferry in my game. Its following a path and turns back.
    Code (csharp):
    1.  
    2. HOTween.To( transform, speed, new TweenParms().Prop( "position",new PlugVector3Path( waypointVectors ).OrientToPath() ).Loops( -1, LoopType.Yoyo ).Ease( EaseType.EaseInOutSine ).OnStepComplete( htCallback));
    3.  
    In the htCallBack I just pause the tween until the character starts the ferry again. Then the ferry is going back.
    That works so far.

    The Problem is that if the ferry reaches the last waypoint its orienting back to the first waypoint (in my case its very fast turn 180 degrees). Then it turns to second last waypoint, which is right one. Why is it orienting for a short time to the first waypoint in case of a yoyo?

    Hope you understand what I mean. Is this the wrong approach or how to fix this?


    Thanks in advance
     
  6. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Izitmee, it works GLORIOUSLY, thanks a LOT. You don't even know how long I've been trying to implement my pause menu GUI while Hotween has been sitting on this forum for longer than this and I didn't see it:

    forum.unity3d.com/threads/124781-Play-Animation-when-Timescale-0?highlight=timescale


    From the start of that thread till now, I couldn't figure this out. Lots of time wasted :/

    I'll definitely give my support for this awesome tool!
     
  7. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @jrricky: now that's a raving review, I'm very glad you found it useful :)

    @yavadoo: I'm ashamed to admit that it looks like a bug. I'm a little busy right now, but I will look into it in the next few hours. Could you send me the list of Vectors you're using for your path? So I can test it with your same stuff.
     
  8. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @yavadoo: quick update. Made some check, and HOTween is behaving as it should. I'll wait for you to post your list of Vectors to see if something comes up :)
     
  9. yavadoo

    yavadoo

    Joined:
    Mar 24, 2012
    Posts:
    102
    Thank you very much for looking after that problem so fast.
    Here the code I use:
    Code (csharp):
    1.  
    2. using UnityEngine;
    3.  
    4. using Holoville.HOTween;
    5. using Holoville.HOTween.Plugins;
    6.  
    7. public class BrickSteer : MonoBehaviour
    8. {
    9.    
    10.     public Transform[] waypoints;
    11.     private Vector3 [] waypointVectors;
    12.     public bool orientToPath = false;
    13.     public float speed = 10;
    14.    
    15.     public void Start() {
    16.         waypointVectors = new Vector3[waypoints.Length];
    17.         for(int i=0;i<waypoints.Length;i++) {
    18.             waypointVectors[i] = waypoints[i].position;
    19.         }
    20.         HOTween.Init();
    21.     }
    22.    
    23.    
    24.     public void switchTriggered() {
    25.         PlugVector3Path pvp;
    26.        
    27.         if(orientToPath)
    28.             pvp = new PlugVector3Path( waypointVectors ).OrientToPath();
    29.         else
    30.             pvp = new PlugVector3Path( waypointVectors );
    31.    
    32.             HOTween.To( transform, speed, new TweenParms().Prop( "position",pvp ).Loops( -1, LoopType.Yoyo ).Ease( EaseType.EaseInOutSine ).UpdateType(UpdateType.Update).OnStepComplete( htCallback));
    33.    
    34.     }
    35.    
    36.     public void htCallback() {
    37.         HOTween.Pause();
    38.     }      
    39.    
    40.     // draws red line from waypoint to waypoint
    41.     public void OnDrawGizmos()
    42.     {
    43.         Gizmos.color = Color.red;
    44.         if(waypoints==null || waypoints.Length == 0)
    45.             return;
    46.        
    47.         for(int i=0;i< waypoints.Length;i++)
    48.         {
    49.             if(waypoints[i] == null)
    50.                 continue;
    51.            
    52.             Vector3 pos = waypoints[i].position;
    53.             if(i>0)
    54.             {
    55.                 Vector3 prev = waypoints[i-1].position;
    56.                 Gizmos.DrawLine(prev,pos);
    57.             }
    58.         }
    59.     }
    60.    
    61. }
    62.  
    For the waypoints I create empty GameObjects and just drag it in to waypoints attribute. I think it doesn't matter what waypoint your are using. But the first and the last waypoint should have a steep angle to see the effect.

    Thanks again for your help.

    Edit: I should have mentioned, this is the code attached to the "ferry" which can be a simple cube or something. switchTriggered is called by the user (in my case touching a certain point at the screen of the device).
     
    Last edited: Apr 2, 2012
  10. DenninDalke

    DenninDalke

    Joined:
    Jun 13, 2011
    Posts:
    5
    Hi Iztmee, any news about mscorlib issue?

    I tried to use the .zip that you send and when I try to compile for iOS.5.1 I got:

    Unhandled Exception: System.ExecutionEngineException: Attempting to JIT compile method 'System.Reflection.MonoProperty:GetterAdapterFrame<UnityEngine.Transform, UnityEngine.Vector3> (System.Reflection.MonoProperty/Getter`2<UnityEngine.Transform, UnityEngine.Vector3>,object)' while running with --aot-only.

    at System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index) [0x00000] in <filename unknown>:0
    at Holoville.HOTween.Plugins.Core.ABSTweenPlugin.GetValue () [0x00000] in <filename unknown>:0
    at Holoville.HOTween.Plugins.Core.ABSTweenPlugin.Startup (Boolean p_onlyCalcSpeedBasedDur) [0x00000] in <filename unknown>:0
    at Holoville.HOTween.Plugins.Core.ABSTweenPlugin.Startup () [0x00000] in <filename unknown>:0
    at Holoville.HOTween.Tweener.Startup () [0x00000] in <filename unknown>:0
    at Holoville.HOTween.Tweener.Update (Single p_shortElapsed, Boolean p_forceUpdate, Boolean p_isStartupIteration) [0x00000] in <filename unknown>:0
    at Holoville.HOTween.Core.ABSTweenComponent.Update (Single p_elapsed) [0x00000] in <filename unknown>:0
    at Holoville.HOTween.HOTween.DoUpdate (UpdateType p_updateType, Single p_elapsed) [0x00000] in <filename unknown>:0
    at Holoville.HOTween.HOTween.Update () [0x00000] in <filename unknown>:0
     
  11. stfx

    stfx

    Joined:
    Jun 15, 2011
    Posts:
    7
    @DenninDalke:

    Phew kinda shocked until I realized that Izitmee uploaded the wrong file.

    Please try the correct one: http://fbe.am/4y0 (you should see a moving cube)

    Thanks
     
  12. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    @Izitmee:
    Is it possible to use HoTween to run Unity animations and particles while Time.timescale = 0.0f?
     
  13. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @DenninDalke: sorry for the upload mistake. Set all the download links to the correct version (ZIP / UnityPackage). Anyway, while stfx investigates new possible implementations, I will upload an alternate HOTween DLL which should work with micro mscorlib within today.

    @yavadoo: going to check it now.

    @AbsurdHart: you can tween stuff while timescale is set to 0 by using the UpdateType.TimeScaleIndependentUpdate (see jrricky similar question on previous page). About Unity animations and particles, never tried that, so I don't know what properties you can actually animate on a Unity animation or particle, but if there are public properties, than you can tween them.
     
    Last edited: Apr 3, 2012
  14. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    New Update: HOTween v0.9.004
    - Fixed bug in PlugVector3Path, where going to the end of a non-closed path would set the eventual transform orientation incorrectly.
    - Added Init parameter which allows to choose if you want the OverwriteManager to be available for enabling/disabling in your project.
    - Various code optimizations and performance improvements (thanks to stfx).

    IMPORTANT: the OverwriteManager is now totally deactivated by default. If you want to use it (by calling HOTween.EnableOverwriteManager, you will first have to activate it via HOTween.Init.

    @yavadoo: this version will fix your path issue :)

    @whoever had issues with micro mscorlib: now you can get a "micro" version of HOTween (either from Google Code or from HOTween's download page), which works with iOS micro mscorlib. Note that you have to delete any previous HOTween DLL and replace it with HOTweenMicro DLL. The usage is identical (and I'll keep it updated along the main HOTween version), thus nothing else will change in your project (though consider that using HOTweenMicro on non-iOS platforms is slightly less performant).
     
    Last edited: Apr 3, 2012
  15. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    By the way, even if now there's a micro mscorlib compatible version of HOTween, it would be really important if someone could test that alternate version with micro mscorlib and iOS (here is the link again: ZIP / UnityPackage), because it might lead to a way faster version of HOTween :)
     
    Last edited: Apr 3, 2012
  16. yavadoo

    yavadoo

    Joined:
    Mar 24, 2012
    Posts:
    102
    Thanks for fixing this issue so fast. Works perfect now.
    I pressed the donate button on your webpage :)
     
  17. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Thanks a lot yavadoo :)
     
  18. DenninDalke

    DenninDalke

    Joined:
    Jun 13, 2011
    Posts:
    5
    Thanx @Izitmee I'm testing the new version of HOTweenMicro on iOS right now, thanks again!
     
  19. DenninDalke

    DenninDalke

    Joined:
    Jun 13, 2011
    Posts:
    5
    Thanks a lot again @Izitmee and @stfx the HOTweenMicro worked fine for iOS 5.1!
     
  20. stfx

    stfx

    Joined:
    Jun 15, 2011
    Posts:
    7
    Do you mean the sample project (with the single moving cube)? Because the hotween micro dll is just a workaround.
     
  21. Dgizusse

    Dgizusse

    Joined:
    Feb 1, 2012
    Posts:
    30
    Got it running with these settings:
     
  22. stfx

    stfx

    Joined:
    Jun 15, 2011
    Posts:
    7
    Nice, thanks a lot for testing ;)
     
  23. Dgizusse

    Dgizusse

    Joined:
    Feb 1, 2012
    Posts:
    30
    If you need anything else tested, I usually keep an eye on this thread or you can send me a PM...
     
  24. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    397
    Is the new dll available yet?
     
  25. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Hey wightwhale, which new DLL are you referring to? If you mean the micro mscorlib compatible one, it's already available on HOTween's website and on Google Code. If instead you mean the improved version of HOTween, we're still making tests and discussing about its pros and cons, so it's just virtual for now :)
     
  26. beannt

    beannt

    Joined:
    Feb 25, 2012
    Posts:
    14
    First of all, thanks very much for greate library, Izitmee, I'm very enjoy using it because of nice and clean API. :)

    But I had crashed on every scenes use HOTween :( on iOS. I tried mscorlib compatible DLL, but no success. On Android, I can use HOTween without any problem. Any suggestion ?
     
  27. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Hey beannt, glad you're liking it :) Though worried about the crashes. The only thing that doesn't work with iOS should be the Emit library, which is ignored with regular HOTween DLL, and totally removed with HOTweenMicro DLL. I'm using HOTween on Android too, but for the game I'm making I have a partner (Blake from Engaging Games) who's building it for iOS, and everything works perfectly.

    Could you write me:
    - the error log you get
    - the configuration you're using for iOS
    - if you're you using simply HOTween or also HOTween Editor
    - how are you creating the tweens
    - also, are you sure it's an HOTween-related issue?

    Sorry for the long list of questions, but all the iOS issues appeared to be solved since a long time (micro mscorlib apart, which was quite recent), so if it's an HOTween bug I'd really want to catch it :p
     
  28. beannt

    beannt

    Joined:
    Feb 25, 2012
    Posts:
    14
    Okie, Izitmee, I will do a deep investigrate on problem and tell you soon.

    The reason that I assume it is HOTween bugs because my game has a lot of scenes with difference gameplay, some scenes use HOTween to do animation. Every scenes use HOTween will crash after the first call to HOTween, other scene work fine.

    I will try to get the information as you suggest. :)
     
  29. beannt

    beannt

    Joined:
    Feb 25, 2012
    Posts:
    14
    Hi, I have done a deeper test and found out what cause the problem :). In the player settings if i choose Net 2.0 in Api Compatible Level (not subset), the app always crashes everytimes. If I change to Subset, it's okie now.
     
  30. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Thanks for the deeper test and the solution :) I never built anything without using 2.0 subset, so I never caught this issue.

    [EDIT] Checked the plain Net 2.0 "limitation", and it really might not have been an HOTween problem, maybe something else happened in those scenes. All the things HOTween uses are included both in the Net 2.0 than in the Net 2.0 subset.
     
    Last edited: Apr 9, 2012
  31. beannt

    beannt

    Joined:
    Feb 25, 2012
    Posts:
    14
    I think it's possible a Unity bug or something :). Anyway, thanks for great library, and I can still use it for my game (cheer ^^).
     
  32. yuewah

    yuewah

    Joined:
    Sep 21, 2009
    Posts:
    98
    I do a very simple test, but don't know why it didn't work.

    Code (csharp):
    1. void Start () {
    2.         Tweener t1 = HOTween.To( cube1, 1f, new TweenParms().Prop("localPosition",new Vector3(10,10,10)).Id("1").Pause() );
    3.         Tweener t2 = HOTween.To( cube2, 1f, new TweenParms().Prop("localPosition",new Vector3(10,10,10)).Id("1").Pause().OnComplete(MyFunction) );
    4.        
    5.         HOTween.PlayForward("1");
    6.  
    7. }
    8.  
    9. private void MyFunction() {
    10.         //Sequence seq = data.tween as Sequence;
    11.         HOTween.PlayBackwards("1");
    12. }
     
  33. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @beannt: cheer ^^

    @yuewah: OnComplete is called when the tween is fully complete. This means that if autoKill is active (as by default), the tween has already been killed when you get the OnComplete notification, thus PlayBackwards won't find it. You need to add the TweenParm AutoKill(false), to prevent the tweens being killed/destroyed when they are completed, so you can go on re-using them.
     
  34. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    397
    Hey, I've the HOTween running on ipad now but for my game a simple slide back and forth is taking up 13ms which is a lot for us. I was wondering if there's a way to get this running faster or if I'm just going to have to scrap it from my game altogether. Hereis mycode
    Code (csharp):
    1.  
    2. void Start()
    3. {
    4.             HOTween.Init();
    5.            
    6.             // C#
    7.             TweenParms parms = new TweenParms ();
    8.             // Both C# than UnityScript
    9.             parms.Prop ( "position", new PlugVector3X ( gameObject.transform.position.x + xSlideAmount ) );
    10.             //parms.Prop ( "position", new Vector3 ( xSlideAmount, 0, 0 ) ); // Position tween
    11.             parms.Prop ( "rotation", new Vector3 ( 0, rotationAmount, 0 ) ); // Rotation tween;
    12.             parms.Prop ( "color", Color.red );
    13.             //parms.Prop("localScale", new Vector3(1, 1, 1)); // Scale tween
    14.             parms.Ease ( easeType ); // Easing type
    15.             parms.Loops ( 10000, loopType );
    16.             parms.UpdateType ( UpdateType.LateUpdate );
    17.             //parms.Delay(1); // Initial delay
    18.             // You can fill the parameters with more options than these ones,
    19.             // check the full list in the documentation
    20.             HOTween.To ( gameObject.transform, 1, parms );
    21. }
    22.  
     
  35. yuewah

    yuewah

    Joined:
    Sep 21, 2009
    Posts:
    98
    I am using HOTween v0.9.004

    Code (csharp):
    1. public int score;
    2. void Start () {
    3.      HOTween.To( this, 1f, new TweenParms().Prop("score", 100 ) );
    4. }
    It throws the following exception
    InvalidCastException: Cannot cast from source type to destination type.
    Holoville.HOTween.Plugins.Core.ABSTweenPlugin.SetValue (System.Object p_value)
    Holoville.HOTween.Plugins.PlugInt.DoUpdate (Single p_totElapsed)
    Holoville.HOTween.Plugins.Core.ABSTweenPlugin.Update (Single p_totElapsed)
    Holoville.HOTween.Tweener.Update (Single p_shortElapsed, Boolean p_forceUpdate, Boolean p_isStartupIteration)
    Holoville.HOTween.Core.ABSTweenComponent.Update (Single p_elapsed)
    Holoville.HOTween.HOTween.DoUpdate (UpdateType p_updateType, Single p_elapsed)
    Holoville.HOTween.HOTween.Update ()
     
  36. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    New release: HOTween v0.9.005
    - Fixed PlugInt bug introduced in previous release.

    @yuewah: sorry for the bug. It was introduced in the previous release, but the new version fixes it :)

    @wightwhale: I found a way to make tweens faster on iOS (not fast as on other platforms, but more than double fast as now - it's not the "new" DLL, just an update to the current one), and am still making additional tests before implementing it. Will release it within next Monday, but consider that the new faster method won't work with HOTweenMicro, where speed will stay the same.

    Anyway, what you mean with using 13 ms? I tested HOTweenMicro iOS with your code and deep profiling, and the running tween (with all its derived processes) takes approx 0.45 ms each frame. Even considering different machines, 13 ms is a difference of 2888%, so there must be something else going on. Could you tell me more about what's happening in your code? And what processes sum up to those 13 ms?

    Also, a note on your code:
    - HOTween.Init should be called only once, and when your application starts, so that its overhead isn't applied when starting the first tween. Also, while running in the Editor, HOTween has an additional overhead to display the total running tweens (which is automatically disabled when outside of the editor). If you want to profile HOTween in the Editor as it would run outside of it, you should call Init like this: HOTween.Init(true,false,false);
    - "parms.Prop ( "color", Color.red );" won't work in your code, because you're applying it to a transform target. You should instead apply it to a target of type material (like gameObject.renderer.material).
    - Also, for performance efficiency (not related to HOTween, but to general Unity usage), if you call gameObject.transform twice, it's better to call it once and store it, so you can re-use it. That's because gameObject.transform is the same as gameObject.GetComponent<Transform>(), and thus has a performance overhead.
     
  37. hima

    hima

    Joined:
    Oct 1, 2010
    Posts:
    183
    Anybody got the latest version to work with iOS basic? It doesn't work for me :(

    Here's the error.

    Code (csharp):
    1.  
    2. ExecutionEngineException: Attempting to JIT compile method 'System.Reflection.MonoProperty:GetterAdapterFrame<FreeSpriteSM2, single> (System.Reflection.MonoProperty/Getter`2<FreeSpriteSM2, single>,object)' while running with --aot-only.
    3.  
    4.   at System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index) [0x00000] in <filename unknown>:0
    5.   at Holoville.HOTween.Plugins.Core.ABSTweenPlugin.GetValue () [0x00000] in <filename unknown>:0
    6.   at Holoville.HOTween.Plugins.Core.ABSTweenPlugin.Startup (Boolean p_onlyCalcSpeedBasedDur) [0x00000] in <filename unknown>:0
    7.   at Holoville.HOTween.Plugins.Core.ABSTweenPlugin.Startup () [0x00000] in <filename unknown>:0
    8.   at Holoville.HOTween.Tweener.Startup () [0x00000] in <filename unknown>:0
    9.   at Holoville.HOTween.Tweener.Update (Single p_shortElapsed, Boolean p_forceUpdate, Boolean p_isStartupIteration) [0x00000] in <filename unknown>:0
    10.   at Holoville.HOTween.HOTween.From (System.Object p_target, Single p_duration, Holoville.HOTween.TweenParms p_parms) [0x00000] in <filename unknown>:0
    11.   at TitleSequence.Start () [0x00000] in <filename unknown>:0
    12.  
    13. (Filename:  Line: -1)
    14.  
    I tried with both HOTween and HOTween micro, both give the same error. I also tried changing from 'Slow but safe' to 'Fast without exception', fast without exception would just crash.

    Any help would be greatly appreciated! It works fine on Android though :/
     
  38. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Hey himatako :) (the smile is for you, not for the bug :p)

    I tried to find a reason for this bug. While monotouch docs state that complete Reflection is available on iOS, I found people "sometimes" having problems with GetValue and some generic vars. Could you try to compile using this HOTweenMicro DLL (v0.9.006 beta)? It should solve the issue, and if it does, I will know what caused it and I will update accordingly also the regular iOS version of HOTween.

    P.S. what is the FreeSpriteSM2 that you're trying to animate?
     
  39. hima

    hima

    Joined:
    Oct 1, 2010
    Posts:
    183
    It works! Thank you so much, Izitmee :D I hope this will help you know what caused the problem! Would you please explain it just for educational purpose?

    FreeSpriteSM2 is part of the FreeSprite package I'm working on. It's basically just a wrapper of SpriteManager2 so that they have the same interface and one can change the sprite backend without having to fix the code. What I was trying to animate is the ImageAlpha property to fade in/out the sprite.
     
    Last edited: Apr 13, 2012
  40. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    New release: HOTween v0.9.006
    - Fixed bug which could sometimes happen when getting properties values on iOS.

    @himatako: great :) On iOS, since Emit can't work, HOTween uses Reflection to get the initial value of the property/field to tween, by doing:
    Code (csharp):
    1.  
    2. propertyInfo.GetValue(target, null);
    3.  
    But it looks that using GetValue on a property can sometimes break the iOS AOT compiler (it depends on the property whose getter you're acquiring: mainly, some kinds of generics won't work - while instead using GetValue with a field has no issues). So now I'm using:
    Code (csharp):
    1.  
    2. propertyInfo.GetGetMethod().Invoke(target, null);
    3.  
    which instead has no issues.
     
    Last edited: Apr 13, 2012
  41. hima

    hima

    Joined:
    Oct 1, 2010
    Posts:
    183
    Thanks for the explanation!

    Does this mean I have to use the Micro version? I'm using Unity Basic so I can't really strip the code.
     
  42. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Absolutely not! :) You can (and should, since you don't need the additional stripping) use the regular HOTween version: I fixed both, and the error was tied to iOS in general, not to micro mscorlib.
     
  43. hima

    hima

    Joined:
    Oct 1, 2010
    Posts:
    183
    Finally got it to work on iPad2 :D Thank you so much for HOTween... It really makes my life easier and I can achieve so many cool effects easier.



    The item's name effect, viewing the room from side to side, typewriter effect of the message box, character's animation crossfade are all done with HOTween :D The overwrite manager was a BIG help. I don't think I can live without it now... Well, I can but I'm gonna be complaining a lot when I have to work on non-Unity project, having to use a Tween engine that doesn't have this feature.
     
  44. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Wow! Grace's Diary is seriously wonderful! :O The general look and feel is impressive, and the diary concept works beautifully. Hey, did you do the drawings too? They fit so perfectly with those light watercolors, and are simply beautiful! Wow! Again! I'm excited that I could lend a little but of help with HOTween, thanks for sharing :) Now I want an iPad to play!!! :D

    P.S. just saw the Alice in Underground video too. Amazing! And again: very beautiful. Love the atmosphere and style: where you going with that?
     
  45. hima

    hima

    Joined:
    Oct 1, 2010
    Posts:
    183
    Thank you! I did the character design and game art concept, but it was my friend PT who redrawn my design and do everything else in the final release. The game is a port of an already finished Flash game I made two years ago for a contest, so you can play Flash version if you want to try :) ( Though I've changed a few things in this version )

    As for Alice, it was supposed to be for a contest but I was too busy with my college project so we could only finish the first stage in Game Maker 7. We're thinking about remaking it in Unity, but we'll see how it goes :)
     
  46. franktinsley

    franktinsley

    Joined:
    Jul 1, 2010
    Posts:
    130
    Hey guys, feel like a real noob for not being able to figure this out but how do I access tweens I create using HOTweenEditor from script? So if I setup an animation like those shown in the tutorial video I can pause and play them from a script? Thanks for making such a great tween engine!
     
  47. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @himatako: played the Flash version :) Though, don't know if it's a bug or not: I found 3 clues, but when talking to Natalie I could mention only one, and than nothing else came to "my" mind. Anyway, really nice, and on an iPad it feels perfect (and I say this in spite of me definitely not being an iPad guy). Also, if you accept votes, I definitely vote for the remaking of Alice in Unity. It looks really awesome :)

    @franktinsley: ehe, that's partly my fault, never thought of mentioning how that could be done. Anyway, you can't directly reference the Tweeners created by HOTweenEditor, but you can still control them via the static HOTween controls, using a "target" parameter.
    For example, let's say you created a tween via HOTweenEditor which animates the position of the transform of a gameObject named "cube" (remember that the target is different from the animated property: "cube.transform" is the target, while "position" is the tweened property), you could pause it like this:
    Code (csharp):
    1.  
    2. HOTween.Pause(cube.transform);
    3.  
    Another way would be to assign a "Tween ID" in HOTweenEditor.
    For example, let's say you assigned the Tween ID "tween01" to some tween, than you could do this:
    Code (csharp):
    1.  
    2. HOTween.Pause("tween01");
    3.  
    which would pause ALL the running tweens to which you gave that ID.
     
  48. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    A word of warning!

    I updated from Unity 3.5 to Unity 3.5.1f2 (released a couple days ago), and it seems that projects containing HOTween (both regular and micro version) crash Unity Editor when you try to open them. I'm investigating the matter (which is most certainly a Unity bug) to find a workaround. Sigh! Has any of you updated Unity to 3.5.1? Could you tell me if you're having this issue too, of if it's just related to my computer, for some reasons?
     
  49. hima

    hima

    Joined:
    Oct 1, 2010
    Posts:
    183
    I was using 3.5.1f2 actually! So I don't think it's the new version. But I was on OSX. I'll try Windows and see if it crashes or not. But it certainly didn't crash when I was using HOTWeen v.0.9.005

    As for Grace's Diary, you can find a walkthrough here : http://jayisgames.com/archives/2010/05/graces_diary.php :)
     
  50. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Warning update: I'm an idiot! :p

    HOTween has no issues with Unity 3.5.1. It's just me that was pointing to it using an mklink in my project. But since I changed the place I stored HOTween (the same day I installed Unity 3.5.1, coincidentally), the mklink wasn't working and was crashing Unity. Sorry for being an alarmist, and thanks himatako for the quick support :) Gonna check the walkthrough now ;)