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

LeanTween - A tweening engine that is up to 5x faster than competing engines!

Discussion in 'Assets and Asset Store' started by dentedpixel, Dec 3, 2012.

  1. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    687
    Code (CSharp):
    1. LeanTween.delayedCall(1.0f, () => Debug.Log("Test")).setIgnoreTimeScale(true);
     
    Only4gamers likes this.
  2. unity_7C40B2B07729C99A3F8B

    unity_7C40B2B07729C99A3F8B

    Joined:
    Jul 28, 2022
    Posts:
    2
    I've seen nice tutorials and they are recent. However, when I try to import (using asset store and package manager) LeanTween I get several errors and I can't use "LeanTween. ---" at all. Searching online I only found a forum of a user with similar errors and their answer was "LeanTween is too old, deprecated in 2018" but I can see it's not, it's still being used. So I have no idea why I get errors and I can't import the package properly. I was using DOTween but it is very complex for my limited knowledge, and all I want to do are position + alpha transitions, nothing crazy, but I can't find a simple way to do that with DOTween while LeanTween seems much easier for this! Any help? Thank you!
    PS: the errors I get are "Error while saving Prefab: 'Assets/LeanTween/Examples/Prefabs/EndlessPiece.prefab'." among several similar errors
     
  3. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    816
    What Unity Version are you using and what LeanTween version are you using? You can try to just delete the Examples folder, if the errors only come from there.
     
    tvemn likes this.
  4. unity_7C40B2B07729C99A3F8B

    unity_7C40B2B07729C99A3F8B

    Joined:
    Jul 28, 2022
    Posts:
    2
    I just had to move LeanTween.cs to the Plugins folder for some reason that I can't understand. Also, my scripts that need to use LeanTween must be in the root folder of the project, if I move the script to any folder, the LeanTween call doesn't work anymore. I'm new to coding and Unity so I don't understand anything. But since it's working this way, I'll keep going
     
  5. clonedd1x

    clonedd1x

    Joined:
    Jun 17, 2022
    Posts:
    1
    Hello, currently I have a bar that is run on time. Is there anyway to decrease the current time. Im thinking something like this. Is there any function etc?

    SetTime(GetTime - 30)

    If anyone could respond it would mean alot
     
  6. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    188
    Does anyone to do a speed tests LeanTween vs DoTween - ? I have a doubt.. proofs, proofs give me a proofs
     
  7. Dark_Seth

    Dark_Seth

    Joined:
    May 28, 2014
    Posts:
    130
    HI All.

    Just installed LeanTween and Getting these errors.

    Any help would be great!

    upload_2022-9-5_16-31-30.png
     
  8. Dark_Seth

    Dark_Seth

    Joined:
    May 28, 2014
    Posts:
    130
    BTW as soon as I remove Cinimachine everthing works. So can't use this
     
  9. dansav

    dansav

    Joined:
    Sep 22, 2005
    Posts:
    499
  10. nivrefilm

    nivrefilm

    Joined:
    Jan 30, 2021
    Posts:
    3
    tvemn likes this.
  11. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    816
    Ah, right. I added a gh-pages site rendering the documentation content. The HTML was not built to be used outside the dentedpixel site, but this gives back basic functionality to browse the docs:
    https://johannesdeml.github.io/LeanTween/classes/LTSpline.html#api-classes

    Note: I have no intention of maintaining the project, I just thought this would be a nice addition, since it was a low hanging fruit.
     
  12. Dark_Seth

    Dark_Seth

    Joined:
    May 28, 2014
    Posts:
    130
    Anybody manage to use this with Cinemachine?
     
  13. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,252
    How can I play a sound (call a function) every time a repeating tween repeats? I have a tween that repeats continuously (setLoopPingPong(-1)), and I need to play a sound every time it starts (or ends). SetOnComplete does nothing if PingPong is set to a positive number, and SetOnStart doesn't seem to work at all (the sample code gives me an error). Is this possible?
     
    Last edited: Jan 11, 2023
  14. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    687
    Maybe not use LoopPingPong and instead play the tween again on SetOnComplete? Or just use a coroutine instead.
     
  15. ObsidianSpire

    ObsidianSpire

    Joined:
    Sep 13, 2013
    Posts:
    47
    Hi, I'm attempting to use LeanTween and I was wondering what the best way to make a group of objects follow behind a jumping target would be? Think Yoshi's Island on the Super Nintendo where the eggs/objects follow Yoshi in their jump path until each egg reaches a spot close enough to stop.

    https://forum.unity.com/threads/dotween-hotween-v2-a-unity-tween-engine.260692/page-62#post-4492342

    That post from a couple years ago in another thread mentions following a moving target, but the sample code I tried from the documentation doesn't work quite like I'd hoped. I was hoping for more of an accurate arc/parabola.

    Code (CSharp):
    1. LTDescr d = LeanTween.followLinear(this.transform, playerController.midPointOfPlayer, LeanProp.position, fMoveSpeedForDoubleJumpFollow);
    2.         //d.setTime(fDur);
    3.         //d.setOnComplete(aResetFromMAXDJ);
    4.         Invoke("ResetCatFromMaxDJ", fDur);
    I already store the position of the target/player along their jump arc in the player's class, but I'm intending to start the following gameObjects on their own arcs before the player is guaranteed to land because it would look weird if they had to wait for the player that much. I saw the "move along a path" function included in the plugin, which looks like it might work, but I think I'd need to update the following object's tween path as new positions for the player's jump arc get stored.

    Is that the right idea and even possible or is something else a better approach?