Search Unity

HOTween: a fast and powerful Unity tween engine

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

  1. omatase

    omatase

    Joined:
    Jul 31, 2014
    Posts:
    159
    I'm a Unity noob and have been using HOTween in my Unity project because I'm so used to using tweening functionality in my previous game projects. Now that I've learned a little more about Mecanim though it seems like they cover a lot of the same functionality. Is there a place you've outlined the advanatages of HOTween over Mecanim? I don't know either well enough to understand when I would use both in a project.

    Thanks!
     
  2. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    Hi @omatase. HOTween in no way means to replace Mecanim, since they're two different things. Mecanim is (mainly) an editor animation system, meaning that you have to create your animations fist and then run them while playing. HOTween instead is made for runtime, meaning that you can create animations directly at runtime and via script. It's up to you to decide what is best for which occasion. To animate things with a few lines of code or dynamically, HOTween (or any other tween engine) is certainly way better and quicker to use than Mecanim, and is especially recommended for GUIs. To create character animations/states Mecanim is better instead.
     
    omatase likes this.
  3. omatase

    omatase

    Joined:
    Jul 31, 2014
    Posts:
    159
    Thanks, I appreciate that clarification. I have been creating HOTween animations exclusively in the UI since that's the way the tutorial on the HOTween site showed how to use it so I'm a little surprised to find out that it's expected to be used all programatically. From what you know of Mecanim is it capable of doing easing? I thought that might be one other thing that sets it apart from Mecanim, but maybe I'm missing that functionality in Mecanim.
     
  4. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    Oh I didn't realize you were talking about HOTween's Visual Editor. HOTween is a scripting animation engine, and the Visual Editor is just an extra (you can also do a lot more stuff via script). Compared to the Visual Editor, Mecanim is indeed better for complex things, while for simple ones I'd say the Visual Editor is still much quicker to setup. Compared to the scripting possibilities, Mecanim can't even put up a fight instead (again, not only with HOTween but with any script tween engine) :p You can see some scripting examples in the docs start page (also, here is HOTween V2 - DOTween - which I released a couple months ago: much much better but no visual editor, at least for now).

    Mecanim has easings, but you have to make them yourselves with Animation Curves (though I just noticed it's pro-only).
     
  5. omatase

    omatase

    Joined:
    Jul 31, 2014
    Posts:
    159
  6. OceanBlue

    OceanBlue

    Joined:
    May 2, 2013
    Posts:
    251
    Hi

    I've been using the following to scale an object:

    Code (csharp):
    1.  
    2. HOTween.From (gameObject.transform, scaleTime, newTweenParms ()
    3.  .Prop("localScale", newVector3(0f, 0f, 0f))
    4.  .Ease (EaseType.EaseOutBounce)
    5.  .Delay (delayTime)
    6.  );
    7.  
    ..however, it only scales the parent and not it's children....

    For example, if i manually scale the parent object's transforms, the children scale up or down correctly. But under HOTtween it doesn't.

    Any ideas? Really need to be able to have the children of the parent object scale with it.
     
  7. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    @OceanBlue Hi. I just checked it out, but tweening a transform like that correctly changes the scale of children too, so everything is right here. Can you replicate this issue in a small barebone project and attach it here, so I can see what other things might be wrong?
     
  8. OceanBlue

    OceanBlue

    Joined:
    May 2, 2013
    Posts:
    251

    I performed an elimination process on my object and its children and discovered that the children are in fact scaling, however, because they have a kinematic rigid body attached to them, at the start of the scale process they're being MOVED to Vector3(0,0,0)! (And they got hidden behind another child of same colour - hence why I couldn't see them)

    So question is, why would the scale reset the transform of an object with rigid body? I removed the rigid body to test and the child scaled and stayed in place exactly as expected.

    Edit: So to repro this, create a sprite, then another as a child of the first sprite. Add a kin' rigidbody to the child sprite. Move this second sprite with the rigidbody so that its transform isn't 0,0,0. Now scale up the parent sprite and watch the child sprite get moved back to 0,0,0.

    Edit2: Do you recommend also that i switch over to Dotween?
     
    Last edited: Oct 13, 2014
  9. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    @OceanBlue I tried to add a kinematic rigidbody to the children and move everything away from 0,0,0 before scaling but it all still works perfectly. I think you must have something in your project acting over those rigidbodies?

    About Edit2, sure, I definitely recommend moving to DOTween. It still says alpha but just because the path plugin is alpha, otherwise there are no open bugs and it seems pretty stable (plus obviously it works much better and is much more usable).
     
  10. OceanBlue

    OceanBlue

    Joined:
    May 2, 2013
    Posts:
    251
    I just created a fresh new project, importing only HOTween and 2D Toolkit. I set it up per above and the issue still exists. I have created a package, but don't want to post it on here as I think it contains 2d toolkit files. Do you use it? Where can I send it to?
     
  11. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    I have 2D Toolkit so it's good for me. You can send me a private message with a dropbox link or something like that.
     
  12. OceanBlue

    OceanBlue

    Joined:
    May 2, 2013
    Posts:
    251
  13. OceanBlue

    OceanBlue

    Joined:
    May 2, 2013
    Posts:
    251
    hi again @Izitmee -

    Another question. I'm trying to yoyo an object so that it scales down from it's original size (1,1,1), then back down to the original size, just once. I wrote the following, but it's not working - it scales down and stays down. What am I doing wrong in this?

    Code (csharp):
    1.  
    2. HOTween.To (my2DTKSprite, 1f, newTweenParms ()
    3. .Prop ("scale", newVector3 (0.80f, 0.80f, 0.80f))
    4. .Ease (EaseType.EaseOutExpo)
    5. .Loops(1, LoopType.Yoyo)
    6. );
    7.  
    I'm scaling a 2DT sprite. But have also tried this on its GO transform instead, with same result

    Thanks.
     
  14. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    @OceanBlue Hiya again! Loops indicate the cycles of an animation, so setting it to 1 will play only once like a regular non-looped tween. You want to set it to 2 instead.
    Code (csharp):
    1. .Loops(2, LoopType.Yoyo)
     
  15. OceanBlue

    OceanBlue

    Joined:
    May 2, 2013
    Posts:
    251
    Oh darrrrr.... thank you! lol
     
  16. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    339
    Is there any way to hotween a Line Renderer vertex?

    I have a two vertex one and I can do this:
    lineRenderer.SetPosition(0, newVector3(start.position.x, start.position.y - 6f, start.position.z));
    lineRenderer.SetPosition(1, newVector3(end.position.x, end.position.y - 6f, end.position.z));

    But I was wondering if I could gradually move these points using hotween.

    Thanks
     
  17. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    @gegagome Since there is no LineRenderer.position property to tween, you would have to create a custom one for each vertex, tween that, and use OnUpdate to set the position. Like this:
    Code (csharp):
    1. public Vector3 lrPosition0;
    2. public Vector3 lrPosition1;
    3. void SomeFunction()
    4. {
    5.   lrPosition0 = /* Current vertex 0 position */
    6.   lrPosition1 = /* Current vertex 1 position */
    7.   // Tween the first vertex (1 second duration)
    8.   HOTween.To(this, 1, "lrPosition0", endPosition0, new TweenParms()
    9.     .OnUpdate(lineRenderer.SetPosition(0, lrPosition0))
    10.   );
    11.   // Tween the second vertex (1 second duration)
    12.   HOTween.To(this, 1, "lrPosition1", endPosition1, new TweenParms()
    13.     .OnUpdate(lineRenderer.SetPosition(1, lrPosition1))
    14.   );
    15. }
     
  18. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    339
    Argghhh

    Somehow this isn't working for me.

    I get:
    The best overloaded method match for `Holoville.HOTween.HOTween.To(object, float, Holoville.HOTween.TweenParms)' has some invalid arguments

    And I tried to match your code:
    Code (CSharp):
    1. HOTween.To (this,
    2.                     1,
    3.                     "start.position",
    4.                     lineRendererHiddenPosition0,
    5.                     new TweenParms().OnUpdate(lineRenderer.SetPosition (0, start.position))
    6.                     );
    7.         HOTween.To (this,
    8.                     1,
    9.                     "end.position",
    10.                     lineRendererHiddenPosition1,
    11.                     new TweenParms().OnUpdate(lineRenderer.SetPosition (1, end.position))
    12.                     );
    But it won't work.

    Would you happen to know what's going on? The only method that accepts a TweenParms only accepts 3 arguments so I am confused.


    Thanks!


     
  19. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    @gegagome I'm very sorry, it was my mistake! I modified the code to add TweenParms after writing the first part, and forgot to adapt it (when using TweenParms you have to use the Prop method parameter to defined the variable to tween, instead than writing it directly in the main To). It should be like this:
    Code (CSharp):
    1. public Vector3 lrPosition0;
    2. public Vector3 lrPosition1;
    3. void SomeFunction()
    4. {
    5.   lrPosition0 = /* Current vertex 0 position */
    6.   lrPosition1 = /* Current vertex 1 position */
    7.   // Tween the first vertex (1 second duration)
    8.   HOTween.To(this, 1, new TweenParms()
    9.     .Prop("lrPosition0", endPosition0)
    10.     .OnUpdate(lineRenderer.SetPosition(0, lrPosition0))
    11.   );
    12.   // Tween the second vertex (1 second duration)
    13.   HOTween.To(this, 1, new TweenParms()
    14.     .Prop("lrPosition1", endPosition1)
    15.     .OnUpdate(lineRenderer.SetPosition(1, lrPosition1))
    16.   );
    17. }
     
  20. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    339
    me again

    Not sure what's happening. I checked your documentation regarding TweenParms and it may be the passing of arguments into OnUpdate what's preventing lineRenderer.SetPosition to work.

    I now have this:
    Code (CSharp):
    1. HOTween.To (this,
    2.                     1,
    3.                     new TweenParms().Prop("lrVisiblePosition0", lrHiddenPosition0)
    4.                                     .OnUpdate(lineRenderer.SetPosition (0, lrVisiblePosition0))
    5.                     );
    6.         HOTween.To (this,
    7.                     1,
    8.                     new TweenParms().Prop("lrVisiblePosition1", lrHiddenPosition1)
    9.                                     .OnUpdate(lineRenderer.SetPosition (1, lrVisiblePosition1))
    10.                     );
    And I get the following errors with the OnUpdate line:
    error CS1502: The best overloaded method match for `Holoville.HOTween.TweenParms.OnUpdate(Holoville.HOTween.Core.TweenDelegate.TweenCallback)' has some invalid arguments

    error CS1503: Argument `#1' cannot convert `void' expression to type `Holoville.HOTween.Core.TweenDelegate.TweenCallback'


    Thanks again
     
  21. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    Ohmygod I am really sorry @gegagome it was my fault again. I'm away from my computer so I can't test the code I write, plus it's a hell of a day, and I'm confusing myself between HOTween and DOTween. The OnUpdate function should be written with lambdas to allow calling a method which requires parameters. Here we go again, this time there should really be no mistakes:
    Code (CSharp):
    1. public Vector3 lrPosition0;
    2. public Vector3 lrPosition1;
    3. void SomeFunction()
    4. {
    5.   lrPosition0 = /* Current vertex 0 position */
    6.   lrPosition1 = /* Current vertex 1 position */
    7.   // Tween the first vertex (1 second duration)
    8.   HOTween.To(this, 1, new TweenParms()
    9.     .Prop("lrPosition0", endPosition0)
    10.     .OnUpdate(()=>lineRenderer.SetPosition(0, lrPosition0))
    11.   );
    12.   // Tween the second vertex (1 second duration)
    13.   HOTween.To(this, 1, new TweenParms()
    14.     .Prop("lrPosition1", endPosition1)
    15.     .OnUpdate(()=>lineRenderer.SetPosition(1, lrPosition1))
    16.   );
    17. }
     
  22. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    339
    You are genius!

    By the way, thank you for taking the time to respond to my silly questions

    Again thanks a lot, it works great!

    It seems that DOTween is the way to go and probably the perfect time for me to transition to it since I still have a ways to go to finish my app. Would you mind telling me how this tween would be handled with your shiny new tween engine?

    Also I often use these:
    Code (CSharp):
    1. HOTween.To (item.transform,
    2.                         0.5f,
    3.                         "localScale",
    4.                         numberScale,
    5.                         false,
    6.                         EaseType.EaseOutQuint,
    7.                         0f);
    But I don't see how to set up the ease using DOTween.

    Thanks
     
  23. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    With all the mistakes I made to write you the correct script I wouldn't say so, but thanks! :D

    About ease, with DOTween you have to chain SetEase. This HOTween code...
    Code (CSharp):
    1. HOTween.To (item.transform,
    2.                         0.5f,
    3.                         "localScale",
    4.                         numberScale,
    5.                         false,
    6.                         EaseType.EaseOutQuint,
    7.                         0f);
    ...becomes this with DOTween, thanks to the shortcuts way:
    Code (csharp):
    1. item.transform.DOScale(numberScale, 0.5f).SetEase(Ease.OutQuint);
    The previous vertex code instead can't use shortcuts but would use the generic way, and there is no need to store lrPosition0/1:
    Code (csharp):
    1. void SomeFunction()
    2. {
    3.   DOTween.To(()=> startPosition0, x=> lineRenderer.SetPosition(0, x), endPosition0, 1);
    4.   DOTween.To(()=> startPosition1, x=> lineRenderer.SetPosition(1, x), endPosition1, 1);
    5. }
     
  24. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    339
    Nice

    I will spend some time tonight replacing HOTween code with DOtween.

    Thanks again
     
  25. stefanob

    stefanob

    Joined:
    Nov 26, 2012
    Posts:
    44
    Hello,
    I use the PlugVector3Path Plugin and I would like to get notified when the tweened object passes a certain Point on the path (one of the Vector3 objects in the Array). Is there a Event or anything else I can use for that?
    Thank you!
     
  26. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    @gegagome Thanks to you ;)

    @stefanob Hi. Sorry but that's not possible, unless you use the internal Tweener.UsePartialPath methods and move from waypoint to waypoint instead than through the whole path, but it's really complicated. If you need something like that I recommend @Baroni's Simple Waypoint System, which implements HOTween and does all the workload.
     
  27. stefanob

    stefanob

    Joined:
    Nov 26, 2012
    Posts:
    44
    Okay, thanks for the quick reply!
     
  28. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    339
    Hi there

    This is again regarding the line renderer. By the way it works fine using DOTween but I need to make it visible and hide it based on events.

    the following code works fine but after checking some of your documentation I learned you have a rewind method which may not apply to me but more importantly wanted to know whether this is the best/most efficient way to tween this line renderer between two positions: (or any other game object for that matter)

    Code (CSharp):
    1. public void LineRendererPositioner()
    2.     {
    3.         if (isLineRendererVisible)
    4.         {
    5.             DOTween.To(()=> lrVisiblePosition0, x=> lineRenderer.SetPosition (0, x), lrHiddenPosition0, 1);
    6.             DOTween.To(()=> lrVisiblePosition1, x=> lineRenderer.SetPosition (1, x), lrHiddenPosition1, 1);
    7.             isLineRendererVisible = false;
    8.         }
    9.         else
    10.         {
    11.             DOTween.To(()=> lrHiddenPosition0, x=> lineRenderer.SetPosition(0, x), lrVisiblePosition0, 1);
    12.             DOTween.To(()=> lrHiddenPosition1, x=> lineRenderer.SetPosition(1, x), lrVisiblePosition1, 1);
    13.             isLineRendererVisible = true;
    14.         }
    15. }
     
  29. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    Hiya!

    For specific object like Transforms DOTween has additional shortcuts (like DOMove), but for a LineRenderer that's the way to go, yes. You could otherwise create a Sequence, but that's a fixed animation and from what I understand your values change each time you want to tween, so I'd say this is the best way for your use case.

    P.S. since you moved to DOTween, I'd suggest to jump to this thread for questions ;)
     
  30. Namake

    Namake

    Joined:
    Nov 4, 2014
    Posts:
    2
    Hi,

    how can I tween position.x linear and position.y nonlinear at the same time?
     
  31. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    @Namake Hi! You'll have to create two separate PlugVector3X/Y tweens, so you can assign a different ease to each of them.
     
  32. Namake

    Namake

    Joined:
    Nov 4, 2014
    Posts:
    2
    Thanks!
     
  33. barjed

    barjed

    Joined:
    May 9, 2013
    Posts:
    68
    Hi,

    I've recently downloaded DOTween and I am really enjoying it. However, since the installation, Unity fails to build for Windows/Web with a Error building Player: Extracting referenced dlls failed. error :(. Any ideas?
     
  34. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    Hi @barjed

    There are no issues with the webplayer and DOTween (I'm finishing a webplayer game right now). Did you run the startup "Tools > DOTween Setup" command? Otherwise, try deleting the DOTween directory and redownloading it (then running the setup), maybe some files got corrupted while moving them around. If nothing works, let me know on what Unity version and OS are you.

    EDIT: by the way, are you sure it's a DOTween issue? Do you have other DLLs in your project? Maybe you have some that requires NET 2.0 instead than the default NET 2.0 subset (see this page)?
     
  35. Little-Big-Monkey

    Little-Big-Monkey

    Joined:
    Mar 4, 2014
    Posts:
    35
    Hi Izitmee,

    Will you update the asset store version to the latest ? It's still 1.3.035 here ..
    Please can you also fix the 4 warnings in the Editor ? It's really annoying in production ..

    (I know we can dwl from your website, but it's easier to manage all pluggin update from asset store)
     
  36. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    Hi @Little Big Monkey,

    the Asset Store is kind of a pain to update, but I'll see if I can do it this week :p In the meantime, I just released a new editor version (1.1.275) on the website that fixes those warnings.
     
  37. Jiem

    Jiem

    Joined:
    Nov 11, 2014
    Posts:
    2
    Hello,
    I'm looking for a way to do tweens with multiple 'anchor' points. I've been using the eaze library for AS3, I could write things like this:
    eaze(myObject).to(myDuration , {x:[0.25,1], y:[0.25,1})
    Using an array gave you the possibilty to force points by which the tween had to pass, using interpolations.
    Is it possible to do something similar with HOTween?

    Thanks a lot for making this API!
     
  38. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    Hi @Jiem
    you can use the PlugVector3Path plugin to make something go through a series of waypoint (see examples here), or use a Sequence to stick multiple tweens together as if in a movie timeline (similar to TimelineMax if you ever used it with AS3).
     
  39. Jiem

    Jiem

    Joined:
    Nov 11, 2014
    Posts:
    2
    Awesome it works great :)
    Another question, is it possible to use HOTween to apply a tint on an object?
     
  40. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    Yey! :)
    If with tint you mean the Tint of a material, you can use the PlugSetColor plugin. If you just want to tween a color instead you can do:
    Code (csharp):
    1. HOTween.To(myTarget, 1, "myColorProperty", someColorToTweenTo);
     
  41. Disper

    Disper

    Joined:
    Nov 12, 2014
    Posts:
    2
    Hello!
    I have a problem with HOTWeen compiling for Windows Store 8. I am developing simple 2d game and use this great and easy to use engine and at first i want to say thank you for this.
    But i have follow problem: when i compile project for Android - all compiles and works good.
    But when i compile project for Windows Store 8, Unity writes many script errors with "using" directives in log. Unity cannot find Holloville namespace, but in unity player all works ok. I googled too long and now have no ideas how to fix that. I hope you will help me! I downloaded and added HOTWeenMicro, but it didnt help me.
    Thanks a lot.
     
  42. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    Hi @Disper, glad you like it :)

    About your issue, maybe you have HOTween in Unity's "Plugins" folder? Since recent version that might cause issues with Windows Store.
     
  43. Disper

    Disper

    Joined:
    Nov 12, 2014
    Posts:
    2
    Your advice is useful! Thanks a lot:)
     
  44. woshihuo12

    woshihuo12

    Joined:
    Jul 18, 2014
    Posts:
    36
    Code (CSharp):
    1. public class MM: MonoBehaviour
    2. {
    3.     int old = 0;
    4.     int new = 100000;  
    5.     ...
    6.      Sequence seqForTxt = new Sequence(new SequenceParms().UpdateType(UpdateType.TimeScaleIndependentUpdate));
    7.      seqForTxt.Append(HOTween.To(this, 1f, new TweenParms().Prop("old", new).Ease(EaseType.EaseOutQuart).OnUpdate(OnCostTimeUpdate)));
    8.      seqForTxt.play();
    9.     ...  
    10.     private void OnCostTimeUpdate()
    11.     {
    12.         Debug.Log("old=",old);
    13.     }
    14. }
    the above code can work very well on windows and IOS..
    but can't work well for Android..
    i use the Hotween Version HOTween v1.3.380 (.zip)
    so this is a bug?
     
  45. woshihuo12

    woshihuo12

    Joined:
    Jul 18, 2014
    Posts:
    36
    oh ,sorry..this not a bug..
    my code have some problems...
     
  46. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    285
    I have a MASSIVE performance spike when starting Tweens. It's giving me a frame stutter in my Android mobile app when starting. I'll attach a screenshot of my profiler. It seems to all be in Tweener.Startup(). Is there any way to cache stuff or something to make this not spike my game?

    I'm sure the answer somehow involves moving to DOTween--but DOTween doesn't have paths yet, and I need them for this game.
     

    Attached Files:

  47. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    @quitebuttery Is that you Ralph? If so, you know the answer, but for the posterity I'll say that HOTweenMicro has a slightly slower update time but a faster startup :)
     
  48. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    285
    Yep that' was me @Izitmee -- I posted this before your advice on Micro. Micro fixed the problem!

    Oh and Simple Waypoint System is AWESOME.
     
    Baroni likes this.
  49. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,229
    It is!!! Glad you like it and honor to @Baroni :)
     
    Baroni likes this.
  50. Dynablaster

    Dynablaster

    Joined:
    Feb 28, 2014
    Posts:
    3
    Hi. This is my first post on Unity forums. I am working on 3d infinite runner game. I want it to be 3 lanes/paths style gameplay so naturally I need to switch between paths and know exactly where on the path am I. I first used itween; got it to switch between paths but determining where on the path am I is not accurate and its clumsy; also the visual path editor is bad. On the other hand today I tried HOTween and the editor is great as is library. I am flicking through it but I can't seem to find a way to switch between paths or get actual point on the path. I would like to know if HOTween can do this and if it can't could you maybe point me to the right path? (pun intended!)
     
unityunity