Search Unity

HOTween: a fast and powerful Unity tween engine

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

  1. _uso212

    _uso212

    Joined:
    Jan 25, 2014
    Posts:
    5
    I'm having difficulties trying to integrate HOTween editor. I downloaded it from the asset store, but after I imported all the package in the "Window" tab, the editor doesn't show up. I'm using Unity 4.3.4f1
     
  2. _uso212

    _uso212

    Joined:
    Jan 25, 2014
    Posts:
    5
    I already managed to make it work, I had to download it from the web page and manually set it up instead of importing it from the asset store.
     
  3. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    Weird, the Asset Store version has always worked. Maybe there was some issue with the Asset Store connection or something like that.
     
  4. DavidDebnar

    DavidDebnar

    Joined:
    Mar 19, 2011
    Posts:
    113
    Hello Izitmee! I have a quick question regarding implementation. Lets say I want an object to pulse like jelly. I figured the best way would be to use EaseOutElastic and tween scale with it. The problem is, you can only tween between two values, meaning to make it pulse I gotta grow it by .1 and then shrink it again. If there a way to apply the EaseOutElastic effect onto the localScale of an object without changing it's scale?

    Thanks,
    David
     
  5. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    Hey Dávid :)

    You could try changing the start localScale just a little bit (like 0.99), and then using an AnimationCurve instead than EaseOutElastic to set the ease. That way, you can play with the curve and create super-high peaks to make the scale change a lot even if the start and end value are similar.
     
  6. DavidDebnar

    DavidDebnar

    Joined:
    Mar 19, 2011
    Posts:
    113
    Actually, I didn't even have to ;)

    If anyone else's interested, here's the code:

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using Holoville.HOTween;
    4.  
    5. public class TweenPulse : MonoBehaviour
    6. {
    7.     public float Strength = 0.25f;
    8.     public float Speed = 1f;
    9.    
    10.     private Tweener Tween;
    11.    
    12.     void Awake ()
    13.     {
    14.         Tween = HOTween.From (transform, Speed, new TweenParms ()
    15.             .Prop ("localScale", transform.localScale - Vector3.one * Strength)
    16.             .Ease (EaseType.EaseOutElastic)
    17.             .AutoKill(false)
    18.             .Pause ()
    19.         );
    20.     }
    21.    
    22.     public void Pulse ()
    23.     {
    24.         Tween.GoToAndPlay (0);
    25.     }
    26. }
     
  7. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    Sweeeeet!!!! :)

    A couple advices (so it will look as if I did something to help you :D):
    - Instead of Tween.GoToAndPlay(0), you can simply do a Tween.Restart(), which I like because it looks cleaner
    - I don't know if you noticed, but there are 2 additional parameters accepted by Ease (overshoot and amplitude), which work with Elastic ease and change its "bouncyness"
     
  8. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    339
    You've already helped me a couple of months ago but now that I resumed work on my scene I have a problem.


    public GameObject selectedShape;
    public Vector3 originalShapePosition = new Vector3(0,0,0);
    public Vector3 zoomedInPosition = new Vector3(0, 5, 0);

    selectedShape = pickedShape;
    originalShapePosition = pickedShape.transform.position;

    HOTween.To (selectedShape, 0.5, "position", originalShapePosition);

    The HOTween line is causing me errors. I looked at your documentation:

    HOTween.To(myObject, 1, "fieldName", 2);

    It may be that I am a noob, but I can't figure out how to make the tween work despite having it work in a different way though.


    Any help would be appreciated.

    Thanls
     
  9. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    339
    SOLVED

    As I said, I am a noob.... the second argument needs to be an integer apparently and I added the '.transform' to the gameObject and it worked.

    public GameObject selectedShape;
    public Vector3 selectedShapeOriginalPosition = new Vector3(0,0,0);
    public Vector3 zoomedInPosition = new Vector3(0, 5, 0);

    HOTween.To (selectedShape.transform, 1, "position", selectedShapeOriginalPosition);

    selectedShapeOriginalPosition is assigned a value depending on what the ray hits.


    THANKS
     
    Last edited: Mar 19, 2014
  10. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    Hey gegagome, glad you solved it :)

    About the second argument though, it doesn't need to be an integer. It's just that, if you want to write a floating point number in C#, you have to add an "f" after it. So it should be "0.5f" and not "0.5" :)
     
  11. Spikeh

    Spikeh

    Joined:
    Jun 7, 2013
    Posts:
    24
    Hey again Izitmee,

    This is a bit convoluted, and I'm not sure it's possible with Hotween. Let me try to explain.

    I'm executing a tween that moves an elevator up and down. Here's my code:

    Code (csharp):
    1.  
    2.         _movementTween = HOTween.To(transform, duration, new TweenParms()
    3.             .Prop("position", destinationWaypoint.transform.position)
    4.             .Ease(EaseType.EaseInOutCubic)
    5.             .OnComplete(x => {
    6.                 // do some things
    7.             }));
    8.  
    Works a treat - note that I'm using an ease type. Cubic isn't perfect for my use, but I was going to change it to an animation curve at a later date.

    So, my issue is this. I want to be able to pause and recommence this tween (or kill / reset the tween), but apply the end of the easetype (the cubic slow down) at the moment the lift is paused. So basically, the elevator needs to stop between floors - slowing down naturally, and recommencing naturally (rather than abruptly).

    Does that make sense? At the moment I'm killing the tween, and re-creating it when the lift starts moving again. That at least gives me a decent animation when the lift recommences.

    I understand that the easing curve is probably calculated based on the duration and distance, hence why I'm not sure if this is possible or not. Is there anything I can do with Hotween to achieve this that I'm missing?
     
  12. jingato

    jingato

    Joined:
    Jun 23, 2010
    Posts:
    274
    Hi, first I want to thank you for the great tween library. I've been very happy with it ever since I switch over from iTween. I have one request that I was hoping you could add to the next build. It is a request to add to the hotween component / visual editor.

    I would really like to be able to choose AnimationCurve from the list of EaseTypes and then be able to supply an AnimationCurve.

    Thanks again~
     
  13. Disastercake

    Disastercake

    Joined:
    Apr 7, 2012
    Posts:
    314
    I'm sorry if this has been asked before, but a search hasn't made any answers pop out at me. Is there a way to tween just values like a Vector3 or a float without them being a property? Or do I need to make them a public property of a game object to tween them?
     
  14. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    @Spikeh: makes perfect sense :) Though there is no way to interrupt a tween and continue it while recalculating the ease completely. The only way is what you're doing: recreating the tween each time.

    @jingato: right! I had to do that and I forgot! Gonna try to implement it now :)

    @Disastercake: anything you tween must be either a public field or a public property, but it doesn't need to be a public field/property of a GameObject: you can tween every public field/property of any class/object.
     
  15. Spikeh

    Spikeh

    Joined:
    Jun 7, 2013
    Posts:
    24
    OK, looks like I might have to rethink how I'm approaching this, then. The abrupt stop is not very realistic :| Thanks for your reply!
     
  16. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    UPDATE! HOTween Visual Editor v1.1.250

    - Added AnimationCurve field as ease option
    - Fixed issue where editor couldn't find all attached Components inside a prefab
    - Fixed some illegible icons

    I submitted it to the Asset Store, but in the meantime you can get it from the website.

    @jingato: voilà ;)
     
  17. jingato

    jingato

    Joined:
    Jun 23, 2010
    Posts:
    274
    That was Fast!

    Thanks :)
     
  18. munstrak

    munstrak

    Joined:
    Feb 14, 2014
    Posts:
    4
    I've got a problem with isTweening. Could you please tell me what I'm doing wrong?
    I tried with Id and IntId and result is the same. In general I've got power up which collected gives you boost, then I'd like to check if the boost is on. As I do more tweenings on the same object, I would like to check it through Id or IntId. The code looks like this:

    Code (csharp):
    1.         if (other.gameObject.tag == "PowerUp")
    2.         {
    3.             Destroy(other.gameObject);
    4.  
    5.             if (other.gameObject.name == "PowerUpQMark(Clone)"  car.velocity.z < 85.0f)
    6.             {
    7.                 nitroSeq = new Sequence(new SequenceParms().Id ("nitro"));
    8.                 if (carRotated == true)
    9.                 {
    10.                     nitroSeq.Append(HOTween.To (carTransform, 0.3f, new TweenParms ().Prop ("rotation", new PlugQuaternion (new Vector3(carTransform.eulerAngles.x,(carTransform.eulerAngles.y+180)%360,carTransform.eulerAngles.z), EaseType.EaseOutQuart, false))));
    11.                     carRotated = false;
    12.                 }
    13.                 nitroSeq.Append(HOTween.To (car, 1.5f, new TweenParms ().Prop ("velocity", new PlugVector3Z (160.0f, EaseType.EaseOutCubic, false))));
    14.                 nitroSeq.AppendInterval(7);
    15.                 nitroSeq.Append(HOTween.To (car, 1.5f, new TweenParms ().Prop ("velocity", new PlugVector3Z (80.0f, EaseType.EaseOutCubic, false))));
    16.                 nitroSeq.Play ();
    17.  
    18.                 if (HOTween.IsTweening("nitro"))
    19.                     Debug.Log ("tween");
    20.  
    21.  
    22.  
    23.             }
    24. }
    Unfortunately I can't make IsTweening show me True value.
     
  19. Matkins

    Matkins

    Joined:
    Aug 24, 2009
    Posts:
    151
    Hello, I'm new to HOTween and I just downloaded the latest versions of the plugin and the editor from your website, and i get the following compile error: "The type or namespace name `HOEditorGUIFramework' does not exist in the namespace `Holoville'. Are you missing an assembly reference?", steming form both HOTweenComponentInspector.cs and HOTweenEditor.cs

    I'm using Unity beta 4.6.0b1, I don't know if that makes any difference.
     
  20. allenwp

    allenwp

    Joined:
    Sep 4, 2013
    Posts:
    40
    Hi Izitmee, I am also getting the following when I import the new HOTween Visual Editor v1.1.250. It seems to be a problem with this editor version specifically, 1.1.201 on the asset store seems to work fine. Any chance of a fix?

    The type or namespace name `HOEditorGUIFramework' does not exist in the namespace `Holoville'

    Thanks for your hard work!
    Allen
     
  21. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    HOTween Visual Editor bugfix

    Sorry for that error: I packaged it incorrectly (without the HOEditorGUIFramework assembly). I uploaded the correct version on the website now. Please let me know if everything's alright.

    @munstrak: weird. I can't check it right now, but will try to investigate that later or tomorrow.
     
  22. Max-Pixel

    Max-Pixel

    Joined:
    Sep 3, 2013
    Posts:
    6
    Hey there. I've searched high and low for this but can't quite figure it out. I need to animate the values of multidimensional arrays, using likewise structured arrays as keyframes. I can't figure out how to specify an array index as the filedName. Here's my code:

    Code (csharp):
    1.  
    2. revealAnimation = new Sequence(new SequenceParms());
    3. TweenParms part1 = new TweenParms();
    4. TweenParms part2 = new TweenParms();
    5. for (int i = LEFT; i <= RIGHT; i++) {
    6.     for (int j = INNER; i <= OUTER; i++) {
    7.         part1.Prop("tempVerticies[" + i + "," + j + "]", midpointVerticies[i,j]);
    8.         part2.Prop("tempVerticies[" + i + "," + j + "]", verticies[i,j]);
    9.         for (int k = IN; i <= OUT; i ++) {
    10.             part1.Prop("tempHandles[" + i + "," + j + "," + k + "]", midpointHandles[i,j,k]);
    11.             part2.Prop("tempHandles[" + i + "," + j + "," + k + "]", handles[i,j,k]);
    12.         }
    13.     }
    14. }
    15. revealAnimation.Append(HOTween.To(this, 0.3f, part1.OnUpdate(AnimateFrame)));
    16. revealAnimation.Append(HOTween.To(this, 0.2f, part2.OnUpdate(AnimateFrame)));
    17. revealAnimation.Play();
    18.  
    It gives me the following error: "red (Rainbow).tempVerticies[0,1]" is missing, static, or not public. The tween for this property will not be created.

    This variable IS public.

    Background:

    I've got RageTools Pro- and found out that they have zero documentation on RageSpline, or how to animate verticies, so their advertising was a bit misleading. Anyways, I've worked on my own solution, but have run into a dead end with HOTween.

    I have a two dimensional and a three dimensional array that I want to animate each value of. I'm using multidimensional arrays as a way of grouping and making sense of an otherwise flat list of 18 points. I have identically structured arrays that act as keyframes.

    I don't want to have 18 flat public variables, that would make the code that sets up the keyframes much larger and less managable.

    I can't animate the values directly, I need to assign them using a Set function on the RageSpline component, which I'm doing in the OnUpdate callback, which is why I'm animating values in a temporary array.
     
    Last edited: Mar 24, 2014
  23. allenwp

    allenwp

    Joined:
    Sep 4, 2013
    Posts:
    40
    Thanks Izitmee! That fixed it the errors I was getting. I still get the four deprecated warnings about the editor, though, just like in the version on the asset store:

    Assets/Holoville/HOTween Extensions/HOTweenManager/Editor/Core/HOTweenEditorGUI.cs(304,42): warning CS0618: `UnityEditor.EditorGUIUtility.LookLikeControls(float)' is obsolete: `LookLikeControls and LookLikeInspector modes are deprecated. Use EditorGUIUtility.labelWidth and EditorGUIUtility.fieldWidth to control label and field widths.'

    Assets/Holoville/HOTween Extensions/HOTweenManager/Editor/Core/HOTweenEditorGUI.cs(473,106): warning CS0618: `UnityEditor.EditorGUIUtility.LookLikeControls(float)' is obsolete: `LookLikeControls and LookLikeInspector modes are deprecated. Use EditorGUIUtility.labelWidth and EditorGUIUtility.fieldWidth to control label and field widths.'

    Assets/Holoville/HOTween Extensions/HOTweenManager/Editor/HOTweenEditor.cs(52,14): warning CS0618: `UnityEditor.Undo.RegisterSceneUndo(string)' is obsolete: `Use DestroyObjectImmediate, RegisterCreatedObjectUndo or RegisterUndo instead.'

    Assets/Holoville/HOTween Extensions/HOTweenManager/Editor/HOTweenEditor.cs(227,14): warning CS0618: `UnityEditor.Undo.RegisterSceneUndo(string)' is obsolete: `Use DestroyObjectImmediate, RegisterCreatedObjectUndo or RegisterUndo instead.'


    Otherwise, everything looks like it's building well to me. :)
     
  24. vvirehead

    vvirehead

    Joined:
    Jan 24, 2014
    Posts:
    2
    Hello there,

    I've enctountered error while using PlugVector3Path() like so:

    Code (csharp):
    1.  HOTween.To(transform, walkSpeed, new TweenParms().Prop("position", new PlugVector3Path(path, EaseType.EaseInOutSine, false).OrientToPath()).SpeedBased().OnComplete(WalkDone).OnPlay(WalkStart));
    The error message is:

    I've narrowed it down to this line of code (line 588 in ABSTweenPlugin.cs):

    Code (csharp):
    1.         protected virtual void SetValue(object p_value)
    2.         {
    3.             if (_useSpeedTransformAccessors) {
    4.                 // Use specific accessors
    5.                 if (_setTransformVector3 != null)
    6.                     _setTransformVector3((Vector3)p_value);
    7.                 else
    8.                     _setTransformQuaternion((Quaternion)p_value);
    9.             } else {

    As a result of this error tweener is stopping but never completing.
    I tried both 1.3.0, Asset Store version and micro.

    Since I have little experience working with .dll in C# I would be gratefull for any help.

    PS Aside from that error - great lib in every way!

    edit: This exception is caused only if all points in path have the same coordinates, which is quite pointless ;)
     
    Last edited: Mar 24, 2014
  25. munstrak

    munstrak

    Joined:
    Feb 14, 2014
    Posts:
    4
    lzitmee, have you had a chance to take a closer look? It's kind of a blocker for me. Thanks in advance.
     
  26. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    @munstrak: sorry, my bad. It was an error with IsTweening and Sequences. I fixed it now :) Just download the latest version from the website, and please let me know if everything's alright

    @Max-Pixel: HOTween has no way to tween an array. But you can create an HOTween plugin for that, if you want. Here's a sample plugin to use for directions.

    @allenwp: agh, you're right, I forgot those. Would you be so kind as to repost that issue at the beginning of next week? Right now I have no time at all.

    @vvirehead: thanks for finding the issue already. I will check it out... uh, next week :p
     
  27. gpvd

    gpvd

    Joined:
    Nov 2, 2013
    Posts:
    76
    Hello,

    I have a question about reusing a tween (make use of ResetAndChangeParms()).
    The way i implemented it doesn't work. I get the following NullReferenceExceoption;
    See below the exception message for a (hopefully) more detailed explenation.

    NullReferenceException: Object reference not set to an instance of an
    object
    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:808)


    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:683)


    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:2173)


    Holoville.HOTween.HOTween.Update ()
    (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__HOTween.Assembly/HOTweenV1/HOTween.cs:728)



    Use-case:

    I scroll a gameobject from point A to B at duration = scrollspeed, using a speedbased tween (reference stored in field scrollTween).
    Next, over time i adjust the scrollspeed.
    Now, when scrollspeed was adjusted, i want to reuse scrollTween by resetting the tween and only apply scrollspeed again(adjusted duration).
    However i now get the NullReferenceException.


    Used following piece of code:

    /* Start scrolling tween. (Move gameobject from current position to endPosition)
    * --- Also gets repeatedly called when the current scrolling speed is adjusted.
    */
    private void startScrollTween(){
    //NOTE: scrollTweenP ,scrollTween, scrollSpeed, endPosition and _transform are global fields.

    if(scrollTween != null)
    scrollTween.ResetAndChangeParms(TweenType.To,scrollSpeed,scrollTweenP);
    else{
    scrollTweenP = new TweenParms(); .
    scrollTweenP.Prop("position",endPosition)).
    SpeedBased(true).
    AutoKill(false);
    scrollTween = HOTween.To(_transform,
    scrollSpeed,
    scrollTweenP);

    }
    }


    When i looked further i saw in Tweener.cs at line 808 that field plugin is null (also resetted ?).
    So i tried to work around using following code:

    scrollTweenP.Prop("position",new Holoville.HOTween.Plugins.Core.PlugVector3(CurrentPart.endScrollPartWorldPosition)).

    Didn't work either.

    Do you have any solution for this?
    (Don't want to kill the tween and create a new one, and it looks like that i my case i can't use LoopType.Incremental either... )


    Many thanks in advance and keep up the good work.
     
  28. munstrak

    munstrak

    Joined:
    Feb 14, 2014
    Posts:
    4
    It works great right now! Thank you very much for fast reaction and help!
     
  29. CenturyEagle

    CenturyEagle

    Joined:
    Mar 25, 2014
    Posts:
    1
    FYI, on your webpage, under 'Examples' the link to d/l the example package for "Using AnimationCurves for easing" seems to be broken
     
  30. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    @gpvd: everything works fine here. Can you create a sample project that replicates this issue and link it here, so I can see what's happening? Also, please remember in the future to wrap your code using the forum's CODE tag, otherwise it's very hard to read :p

    @munstrak: great :) Will push it officially as soon as I validate a small new feature I've done.

    @CenturyEagle: ooops, sorry. I recently changed server and that file apparently got lost. Fixed.
     
  31. gpvd

    gpvd

    Joined:
    Nov 2, 2013
    Posts:
    76
    Hello,

    Well, It does work in my sample project and cannot replicate the issue.

    I honestly have no clue why it does work in my sample project, but does not in my 'real' project...
    One strange thing; In my real project i did got it working by disabling the OverwriteManager.
    But in my sample project, enabling/disabling the OverwriteManager didn't reproduce the issue.

    Until i have a clue again ;-), i'll just creating the tween again instead of ResetAndChangeParms().

    Thank you very much for looking at it.
     
  32. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    339
    Hey it's me again

    Is it possible to create a slide in menu that functions like iOS 7's vertical menus? (notification center's swipe down and control center's swipe up)

    What I want is a side menu that users could swipe in/out at their own speed but also snaps to both states (on-screen and off-screen)


    Any ideas?

    Thanks
     
  33. gpvd

    gpvd

    Joined:
    Nov 2, 2013
    Posts:
    76
    Hello,

    Well, i created a sample project that reproduces the error.
    Could you please be so kind to look at it. I probably made an misstake somewhere...

    Project usage ==> When running, change the value ADJUSTME in the Cube.

    Many many thanks in advance.
     

    Attached Files:

  34. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    @gpvd: great! I should be able to look at it this afternoon :)

    @gegagome: I don't have an iOS device, but I suppose the notification center swipe works like Android's. If so, it would be a matter of determining the speed of the drag action, and then, when the user stops dragging, create a tween whose speed is based on that to complete the rolling/unrolling of the panel.
     
  35. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    @gpvd: I managed to look into it already. It was a bug due to the OverwriteManager not dealing correctly with ResetAndChangeParms. I fixed it and you can get the last version from the website :)
     
  36. gpvd

    gpvd

    Joined:
    Nov 2, 2013
    Posts:
    76
    Thank you very much for looking into it and fixing it!!!!!
    keep up the great work and support :D
     
  37. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    506
    How do I tween values in the RenderSettings, such as ambientLight or fog? Usually you just do something like RenderSettings.ambientLight = myColor;

    Code (csharp):
    1. HOTween.To(RenderSettings, tweenDuration, "ambientLight", ambientColor); //This doesn't work.
     
  38. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    Static properties cannot be tweened directly. You'll have to create a public dynamic accessor which modifies RenderSettings.ambientLight, and tween that.
     
  39. CodeFighter

    CodeFighter

    Joined:
    Dec 15, 2012
    Posts:
    63
    Hello! How to play animation from Component?
    I not use HotTweenManager because i need to play animation independently for created from prefab object.
    But using visual editor directly like component very useful. Thank you!
     
  40. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    414
    Hi there.

    I'm trying for the first time to compile something to windows phone 8 and the building process fails at the end with this:

    I tried using the micro version from the website so i don't really know whats going on:

    The text not in english says something like "The operation is not valid due to the actual state of the object"

    any hints to what could be causing it?
     
  41. FredZvt81

    FredZvt81

    Joined:
    Apr 8, 2014
    Posts:
    23
    I'm trying to create a sequence in which in one of its steps I have to play some Tweeners in paralell.
    It's hard to explain in words... Imagine the following Sequence:

    1. Move object A.
    2. Move object B AND Move object C AT THE SAME TIME.
    3. Move object D.

    My problem is that I do not know how to set step 2, since a Sequence only has methods to append, insert or prepend one Tweener after another.

    I thought of solving this issue using callbacks but could not get the desired result and the code became messy.

    Any help will be very helpful.
     
  42. soxroxr

    soxroxr

    Joined:
    Jul 17, 2012
    Posts:
    60
    Hello!

    I'm trying to get my game object to rotate to face the direction of the movement. OrientToPath does that, but it has some other weird results, like causing my object to rotate to the side quite heavily. I understand it rotating to face up when going up hill, that's good, but I'm not sure why it rotates to the side.

    Any tips?

    Thanks!
     
  43. munstrak

    munstrak

    Joined:
    Feb 14, 2014
    Posts:
    4
    Izitmee, I've got a problem. Few weeks back I downloaded HOTween from Asset Store and after your patch I downloaded new version from the website. I switched files directly in Unity (drag and drop to Unity window) it seemed fine till I restart Unity. Then it seems to use old version of HOTween and your patch doesn't work. How should I install version from website permanently?
     
  44. CremaGames

    CremaGames

    Joined:
    Mar 5, 2014
    Posts:
    59
    I'm very interested in doing this same thing, it would be great if we have a Parallel class in the same way we have a Sequence class. In going to look into the source to see if it's easy enough for me to do it.
     
  45. c-Row

    c-Row

    Joined:
    Nov 10, 2009
    Posts:
    799
    Tweens can be inserted with the same starting time, though. ;) I ran into a similar problem (see page 58) before. The code below is taken from my current project.

    Code (csharp):
    1.  
    2. linkToPointSequence.Insert(0f, HOTween.To (unit.gameObject.GetComponent<Unit>().image, 0.3f, "color", new Color (1f, 1f, 1f, 1f)));
    3.  
    The first parameter sets the starting time within the sequence.
     
    Last edited: Apr 9, 2014
  46. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    @CodeFighter: the Visual Editor component works like the regular panel, and it should play automatically.

    @FredZvt81: Insert is the way to go. If, for example, tween A has a duration of 1 second, you can then use Insert with a time of 1 for both Tween B and Tween C, and they will be played together.

    @soxroxr: hi! Did you try using the second optional parameter of OrientToPath to block some of the rotation axis? Seems like what you need.

    @munstrak: maybe Unity did something weird when overwriting them. Try overwriting them from outside Unity: that's what I always do and it works :)

    @CremaGames: see the answer to Fred. Sequences are indeed made to work also in parallel.

    @c-Row: thanks for answering :) Too bad I saw it only after answering myself, or I would've spared a few words :D
     
    Last edited: Apr 9, 2014
  47. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    @kebrus: are you sure you're using HOTweenMicro? In the latest version, clicking on the DLL inside Unity should say Micro.
     
  48. CremaGames

    CremaGames

    Joined:
    Mar 5, 2014
    Posts:
    59
    I'm trying with the Insert but the results are not as expected. Here's the pseudocode:

    Code (csharp):
    1. Sequence seqMaster = new Sequence();
    2.  
    3. for (int x = 0; x <= 10; x++) {
    4.    Sequence seq = new Sequence();
    5.  
    6.    for (int y = 0; y <= 10; y++) {
    7.       seq.Insert(0f, HOTween.To...);
    8.    }
    9.  
    10.    seqMaster.Append(seq);
    11. }
    12.  
    13. seqMaster.Play();
    With this all the HOTween.Tos are done in sequence instead of in parallel.
     
  49. c-Row

    c-Row

    Joined:
    Nov 10, 2009
    Posts:
    799
    Does this happen without the outer for loop as well?

    Code (csharp):
    1.  
    2.     Sequence seqMaster = new Sequence();
    3.          
    4.        for (int y = 0; y <= 10; y++) {
    5.           seqMaster.Insert(0f, HOTween.To...);
    6.        }
    7.          
    8.     seqMaster.Play();
    9.  
     
  50. CremaGames

    CremaGames

    Joined:
    Mar 5, 2014
    Posts:
    59
    No, but that isn't what I want to achieve.

    I need to create a sequence with 10 groups, these groups will be played in sequence. Now, each group has 10 tweens that will be played in parallel.
     
unityunity