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

Best Tweening Or-The-Like Functionality In / For Unity?

Discussion in 'Editor & General Support' started by omatase, Sep 6, 2014.

  1. omatase

    omatase

    Joined:
    Jul 31, 2014
    Posts:
    159
    In the past as I've used lesser engines I've relied heavily on tweening libraries to move objects around the screen in a way that looks more natural.

    I'm new to Unity and need a way to do this in Unity now. I've done some searching and found several Unity tweening libraries but I'd like input from more seasoned users on which of those may be best (or at least some referrals for a good one). I've searched these forums for "best tweening library" as well as google for "unity best tweening library" as well as variations but every search result I find is written by the author of the library the post is about.

    I'd also like to make sure I don't overlook something in Unity that will do what I need to do without an external library. Sometimes searching for things about Unity doesn't yield results containing the latest information (e.g. when I search for nesting prefabs and most of the results lead me to believe it's still not possible in the latest version).

    For completeness, I'm looking for one that can support the common easers in tweening libraries:
    • Linear
    • Quadratic
    • Cubic
    • Quartic
    • Quintic
    • Sinusoidal
    • Exponential
    • Circular
    • Elastic
    • Back
    • Bounce
    Thanks all for your awesomeness and help!
     
  2. Hyblademin

    Hyblademin

    Joined:
    Oct 14, 2013
    Posts:
    725
    Unity's animation window can be used to do some inbetweening on motions, but depending on what you're trying to do, it might not be the best method. Can you tell us what you're moving around the screen? Characters? Buttons?
     
  3. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,952
    I use a mix of the Unity built in animation and HOTween. (https://www.assetstore.unity3d.com/en/#!/content/3311)

    I have experimented with several of the packages, but keep coming back to HOTween. I am pretty much at the point now where I just add it to any new projects right of the bat. What I like about it:
    - The sequencer, it works really well and very efficient, you can stack up a ton of actions, and have individual callbacks, or ones based on the sequence. You can mod and tweak the sequence pretty extensively.
    - Very well structured, the implementation is elegant.
    - Has all the standard easing, plus dead simple way to do custom eases with animation curves.
    - pathing plugins work very well.

    Take a look at it, it is free and just a really polished package. (also, the author is working an follow package that looks promising)
     
    flaminghairball and omatase like this.
  4. omatase

    omatase

    Joined:
    Jul 31, 2014
    Posts:
    159
    This is perfect, thanks! The only dilemma I have now is whether I want to use the old version (HOTween) or the new version (DOTween). Apparently DOTween is still in alpha but is like 4 billion times better.
     
  5. omatase

    omatase

    Joined:
    Jul 31, 2014
    Posts:
    159
    I'm moving characters in some cases, for choreographing fight scenes but pretty much moving everything including prefabs, GUI components, etc.
     
  6. Hyblademin

    Hyblademin

    Joined:
    Oct 14, 2013
    Posts:
    725
  7. omatase

    omatase

    Joined:
    Jul 31, 2014
    Posts:
    159
    I'm really enjoying this HOTween library. It's easy to use and the animations look nice. I find it hard to find information on using it. They have pretty good documentation on the API and the getting started video was nice for .. getting started, but I can't find good examples on how to do some things. Any ideas where I can find information on it? Should I just use these forums?

    Right now I have an animation on a component that is working fine when I leave the play to auto but when I turn off the auto start I can't figure out how to start it manually in my script. I'm trying this code, but it's not working.

    Code (CSharp):
    1. var tweener = GetComponent<HOTweenComponent>();
    2. tweener.animation.Play();
    Thanks
     
  8. NomadKing

    NomadKing

    Joined:
    Feb 11, 2010
    Posts:
    1,461
    There's a HOTween thread over in the asset store section, so either post in there or PM the creator (@Izitmee) and I'm sure he can answer any questions.
     
  9. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Since I was tagged (hey @NomadKing! I get email notifications now! wohooo!) I'm humbly jumping in the conversation a moment.

    For HOTween questions post in this thread and I will get immediately a mail. About your question (by the way glad you like it), when using the Visual Editor you can give an ID to a tween. Then you can use HOTween's static methods to run events only on tweens with a given ID.
    For example, if your tween's ID is "myTweenBlahblah", you would do this to play it:
    Code (csharp):
    1. HOTween.Play("myTweenBlahblah");
    (or, to play ALL tweens you have created):
    Code (csharp):
    1. HOTween.Play();
     
    Last edited: Sep 10, 2014
  10. omatase

    omatase

    Joined:
    Jul 31, 2014
    Posts:
    159
    Awesome Izitmee, very helpful. Thanks it works. And yes I like HOTween a lot the animations were much smoother than the animator built into Unity.