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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

LeanTween Editor - Released!

Discussion in 'Assets and Asset Store' started by dentedpixel, Jul 16, 2013.

  1. Fritsl

    Fritsl

    Joined:
    Mar 10, 2013
    Posts:
    211
    Hi Dented, awesome visual editor, but we ran into a workflow issue with a team using your products on various technical levels, maybe you can suggest a solution:

    A (Artist) would like to use the visual editor - no problem.
    However he might want to have multiple animations ready for same element.

    B (Programmer) would like to say 'You just set up 2-3 funky animations for this button on the GameObject, and change them later in the visual editor on if you please': I am programming things so I am calling your animations when we need them.

    ---

    Issue: As we know off, things are fired at Enable - if we would like to fire off later (do it via script), we should copy-paste the generated code.. BUT THEN THE VISUAL EDITOR NO LONGER MAKES SENSE; it has moved from art to tech, and can no longer be tweaked without messing with code again.. leaving us with a poor workflow as a team.

    Do you follow? is there an obvious solution we did not see? Thanks a bunch :)
     
  2. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hey Fritsl,

    Thanks for the feedback. I do understand your issue and I think it could be a common pain point that should be resolved.

    I am going to add an option to toggle off the animation happening on enable and give a direct call to start the animation where you pass a gameObject for it to target. I think that should work with your work flow right?

    I am glad you are liking the editor otherwise though :)
     
  3. Fritsl

    Fritsl

    Joined:
    Mar 10, 2013
    Posts:
    211
    Thanks, that's super.

    A) Could you add an (optional) parameter apart from only GameObject as target? The parameter should (what ever way you see fit, name, number..) indicate which animation to be fired, adding extra functionality to your overall system so a button can for example go *Good* or *Bad* via visual indicating.

    B) Knowing how long it takes for Unity Asset store updates to go through, and the fact that you may like a beta tester, and since my only alternative is to install an alternative package (my collegaues cannot wait more than a couple of days for this to be ready somehow ;) ) - maybe you could PM me code when done? (or fritsl at spacetimefoam dot dk )

    Thanks again :)
     
  4. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Oh sure, I will make sure to PM you the result once I have something.
     
  5. Fritsl

    Fritsl

    Joined:
    Mar 10, 2013
    Posts:
    211
    Awesome, you totally rock ;) Thanks!
     
  6. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Just wanted to make sure you got my PM with the updated editor. Let me know if the workflow is still impeded.
     
  7. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Hello,
    from reading your description I take it that LeanTween Editor allows us to parent path points to a gameObject which can be placed, rotated and scaled anywhere - and the path adjusts itself nicely?
    This very same gameObject could be packed into another prefab and work when instantiating said prefab?
    This is a selling point to us, thx.
     
  8. kiroodev

    kiroodev

    Joined:
    Oct 14, 2016
    Posts:
    2
    hello, thank you for your work.
    I use editor version, but it seems not working properly.
    LeanTweenVisual changed are not recorded.
    when I change tweens values and reload the scene, I lose value.
    please help me!
     
  9. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi Kirodev,
    Yikes! I am seeing the same behavior too. Thank you for alerting me to the bug, I am looking into a fix now...
     
  10. kiroodev

    kiroodev

    Joined:
    Oct 14, 2016
    Posts:
    2
    ok, is cool, good job
     
  11. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi Kirodev,
    The latest version in the store should fix this problem. Let me know if you continue to have issues!
     
  12. blindmen

    blindmen

    Joined:
    Sep 10, 2015
    Posts:
    34
    Hi there,

    I have a simple use case, but I'm not able to find a correct solution :)

    1. I need an airplane to go through 3 nodes with Orient to Path turned on in about 4 seconds.
    2. Then I need an object to hover up and down with Orient to Path turned on for about 15 seconds
    3. After the hover I need an airplane to speed up and go away through 3 another nodes in 3 seconds with Orient to Path turned on

    My wish:
    I would like to use editor for this.
    I would like to test the movement in Editor without running the app

    My problems are:
    1. I have created 3 paths. When 1st path finish and 2nd starts the rotation of the object change suddenly.
    2. Can I assign different sound for each tween when it starts?
    3. Can I trigger some action when starting next tween?

    P.S: Movement type is set up as moveSpline

    Many thanks
     
    jzq740176597 likes this.
  13. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    189
    How does convert from DoTween to LearnTween :
    Code (CSharp):
    1. var seq = DOTween.Sequence();
    2. seq.Append(core.DOScale(scale, halhTime))
    3.     .Append((distX > distZ) ? core.DOMoveX(posX, timeMov) : core.DOMoveZ(posZ, timeMov))
    4.     .Append((distX > distZ) ? core.DOMoveZ(posZ, halhTime) : core.DOMoveX(posX, halhTime))
    5.     .PrependInterval(halhTime+timeMov)
    6.     .Append(core.DOScale(Vector3.one, halhTime))
    7. .OnComplete(() => OnCompleteMoving(core));
    if LearnTween doen't have sequence..?
    ---
    I done but sequence is not bad idea
     
    Last edited: Oct 31, 2016
  14. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Yeah, a sequencer would be nice, it's definitely on my list of things to do next. You can get away without one though by just staggering out the delays of the tween to get the same effect. I guess that is a little more tedious than a sequence though.
     
    yuliyF likes this.
  15. Mr_Mendel

    Mr_Mendel

    Joined:
    Dec 31, 2013
    Posts:
    19
    Hi,

    I don't know if I am being an idiot but is there a way to do relative paths. So I want to make a set of paths for objects to animate but the first node would essentially be the starting point and they move relative to that. Basically allows waves of enemies to follow the same path at different place.

    Thx mike
     
  16. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi Mr_Mendel,

    Could you just start each enemy on a delay? Like:

    Code (CSharp):
    1. LeanTween.move(gameObject, new Vector3[]{new Vector3(0f,0f,0f),new Vector3(1f,0f,0f),new Vector3(1f,0f,0f),new Vector3(1f,0f,1f)}, 1.5f).setDelay( 2.5 * waveReleaseSpeed );
    You can also look at the example scene for iterating on a path if you want finer control: ExampleCirclePathCS
     
  17. Mr_Mendel

    Mr_Mendel

    Joined:
    Dec 31, 2013
    Posts:
    19
    Hi,
    I think you missed my question.

    Say I create new path starting at 0,0,0 and then goes to 1,1,0.

    When I apply the path to my object it actually goes to 0,0,0 and moves to 1,1,0

    what I want is relative pathing so the 0,0,0 is whatever the objects current position is and it would then move 1,1 up right.
    This way I can create patterns and then apply to them different objects rather than haveing to make a enw path for each one evne though the pattern is the same.
     
  18. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hmm I think you might be wanting to use moveLocal where the object is moved in local space for the inputs, so there can be just one pattern, but it will be interpreted for that objects space... http://dentedpixel.com/LeanTweenDocumentation/classes/LeanTween.html#method_LeanTween.moveLocal
     
  19. Mr_Mendel

    Mr_Mendel

    Joined:
    Dec 31, 2013
    Posts:
    19
  20. Mr_Mendel

    Mr_Mendel

    Joined:
    Dec 31, 2013
    Posts:
    19
    Right OK so I solved it myself I have to have a parent object who i place where i want and then the child sits at 0,0,0 local. Then all the patterns work. Weird that I cannot just set an option relative and then it calculate an offset to be used throughout, I could easily code it myself but then when an update happens I have to remember to change it. Annoyingly i suppose it means I have to have a parent object on everything and then position all objects at local 0,0,0.
     
  21. scary_code_monkey

    scary_code_monkey

    Joined:
    Jun 27, 2016
    Posts:
    10
    Any chance the documentation could be updated/upgraded to cover .setAxis() option - it would have saved me hours of headscratching & 3d mental gymanastics :)
    An added notation/explanation on how it affects the OrientToPath would be great.
    - thanks in advance :)
     
  22. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Sure, I have updated the documentation http://dentedpixel.com/LeanTweenDocumentation/classes/LTDescr.html#method_setAxis

    Sorry about all the wasted time! Hopefully the next person can be spared the headscratching.
     
  23. scary_code_monkey

    scary_code_monkey

    Joined:
    Jun 27, 2016
    Posts:
    10
    dentedpixel: That's great ! - Thanks :)

    For searchers :
    As I understand it - setAxis() is used to control the orientation of the object following the path : think of a 2d Rocketship, and a vertical path , you want the rockets nose to follow the path (not for the rocket to fly up sideways) - this overcomes the default axis orientation of the game object being used.... Obvious when you know, easily missed when you don't cotton on to the internal defaults of OrientToPath... Hope this helps :)
     
    Thorny2000 likes this.
  24. Thorny2000

    Thorny2000

    Joined:
    Sep 18, 2014
    Posts:
    53
    That's a great explanation, looking at the docs I didn't understand it at all. Kinda wish this was in the docs DP ;)

    Small unrelated request: In the LeanTween Editor's LeanTweenPath, the nodes it creates have Cast Shadow and Receive Shadows set on, would be nicer if they were off so my scene didn't start baking again when in auto bake.
     
  25. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Thanks for letting me know about the shadow casting bug. I have fixed it and I will include that in the next update of the editor.
     
    Thorny2000 likes this.
  26. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,440
    Hello,

    I'm considering purchasing your product, but I'd need to ensure it contains specific functionalities.

    Given a 3D point, I'd need to know:
    • The closest point in the spline to the given point.
    • If the spline is closed, get whether the given point is inside or outside the spline boundary.
    Does your package offer any of these features?

    Thank you very much!
     
  27. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi Edy,

    I used your vehicle physics package in the past, it was really great :)

    It does offer the first bullet point you mentioned. It does not offer the second unfortunately. That would seem like a sort of hard challenge, I think your best bet is to make a polygon collider 2d with some of the path data points, and then do a raycast check to see if a point hits this polygon collider...

    I hope that helps!
    Russ
     
    Edy likes this.
  28. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,440
    Thanks Russ for the reply! About the first bullet point, getting the closest point in the spline to a given point: is this operation performed in a mathematical way using the spline definition, or does it require sampling the spline and checking against the resulting points?
     
  29. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    The spline is broken out into a finer set of points of equal length, and then amongst this finer set it compares which one is the closest. So the accuracy depends on the resolution of these finer points, but it is pretty detailed with the default setting.
     
  30. mediajolt

    mediajolt

    Joined:
    Nov 1, 2012
    Posts:
    18
    Is there a way to change the game object's orientation in editor? I've got some bird sprites flying in a circle around the player in a 3D scene, but LeanTween wants to lock their rotation 90 degrees from what I need them to be to be visible to the camera. Playing with the different combinations of Orient to Path and 2D Path don't get me where I need to be, and even putting the sprite into an empty and letting LeanTween control the empty still somehow forces the child game object to the same orientation. Suggestions on how I might be able to fix this, please? Thanks!
     
  31. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi there,
    If you take off orient to path ie: .setOrientToPath(false) also do not make it a 2d path, it shouldn't effect rotation at all, so whatever rotation you set initially should be preserved while it moves along the path. Were you animating with the visual editor or code? That will just help if there is any follow up issues. Thanks!
     
  32. Vortavasail

    Vortavasail

    Joined:
    Apr 22, 2016
    Posts:
    44
    can you have gameobjects evenly spaced out on a leantween path ?
     
  33. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
  34. GiedriusTamulaitis

    GiedriusTamulaitis

    Joined:
    Feb 6, 2013
    Posts:
    3
    Hi, i recently started using LeanTween and bought the visual editor. How can I pause, play and cancel the tweens defined in "Lean Tween Visual" component?
     
  35. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi there,

    You can start the tween by unchecking the "play on start" option, and then referencing the LeanTweenVisual component and calling start method.

    To pause/resume you should be able to use the:

    LeanTween.pause( gameObject );
    LeanTween.resume( gameObject );

    and for cancel:
    LeanTween.cancel( gameObject );

    I hope that helps!
    Russ
     
  36. GiedriusTamulaitis

    GiedriusTamulaitis

    Joined:
    Feb 6, 2013
    Posts:
    3
    Thanks, that's exactly what i needed. The main problem was that LeanTweenVisual component is in another namespace, so I wasn't unable to reference it in my scripts. Should have just looked at the source code.

    Anyway, thanks for a great plugin!
     
    dentedpixel likes this.
  37. GiedriusTamulaitis

    GiedriusTamulaitis

    Joined:
    Feb 6, 2013
    Posts:
    3
    I have a problem with Lean Tween Visual component. If I set tween type to "move (bezier)" and drag LeanTweenPath onto "LeanTweenPath:" field everything works ok. But when I want to change the path and drag new LeanTweenPath onto "LeanTweenPath:" field it seems that new path is set (it shows the name of new LeanTweenPath object in the field), but when i hit Play the field resets to the old value and stays that way after I press stop. What am I doing wrong?
     
  38. Sabrino

    Sabrino

    Joined:
    Aug 8, 2015
    Posts:
    35
    There seems to be a bug with the setRecursive optional parameter. I call LeanTween.alpha on a root object, and it forcibly tweens all the children anyway even if I setRecursive(false).
     
  39. JesterGameCraft

    JesterGameCraft

    Joined:
    Feb 26, 2013
    Posts:
    447
    Hi,

    What is the performance of this asset. I use LeanTween and performance is great, just wondering what kind of overhead LeanTweenPath incurs.

    Thank You.
     
  40. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi there,
    Performance is pretty good (I have tweaked it over the years to make sure of it), but it is has been a compromise between accuracy and performance.
     
  41. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    189
    But.. hope, you will add a sequence for more complicated animation
     
  42. JesterGameCraft

    JesterGameCraft

    Joined:
    Feb 26, 2013
    Posts:
    447
    Thanks for getting back.
     
  43. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Yeah I had been thinking of writing a new animator from scratch (the one in there now was given to me by a user, which is nice but a little quirky). I would probably have mine more similar to the Adobe Flash timeline, which I was a fan of back in the day when Flash was still relevant :p
     
    yuliyF likes this.
  44. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    I have been having trouble with the asset import. In the Unity asset import window when I click the 'All button' Not all the items are selected. I did submit to Unity support about Procore import misbehaving the same way. For that asset it mysteriously fixed itself. But for LeanTween it has not. Unity support did acknowledge it is Unity not performing correctly as they were able to reproduce the error. Duplicating the error is a big deal as anybody in development can attest to. I hope they up the priority to get this fixed. My Unity efforts at this moment are at a standstill. Attached is an the import window screen shot.
     

    Attached Files:

  45. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Thanks for letting me know! Is this on 2017.2? It works ok for me on a Mac, but I am just importing it from the asset store with a fresh project, so there might be something in your current project that is breaking things (or possibly it's a Windows only bug, if you can recreate it with a fresh project).

    The only items needed to run LeanTween are in the Plugins/LeanTween folder, so you can always download those directly to that folder in your project from github: https://github.com/dentedpixel/LeanTween/tree/master/Assets/Plugins (just make sure to put the contents in the Plugins/LeanTween folder in your own project).
     
  46. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    I went to the Plugins/LeanTween folder and uncompressed the zip there. Then went back to unity and reimported. Just trying things here. Still nothing in the tools menu bar dropdown to use. Is there supposed to be? Here are the unity panels also.
     

    Attached Files:

  47. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Oh sorry you don't want to unzip that dll, and I was wrong in saying you should go to github for the scripts (that is not for the editor but just the LeanTween plugin standalone).

    So the base of the problem where you cannot import the asset. Can you manually select all the files needed? I will try and send you a *.package file, and maybe that will work? I think something is messed up with your base project, I would delete all things in folders LeanTween LeanTweenEditor and Plugins/LeanTween and try from scratch...
     
  48. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    Up front, Here is the screenshot for the latest Unity version and the Leantween import screen. The ALL button now selects all the assets. But nothing about using the editor script which I assume is the front door to the leantween set of tools.
    upload_2017-11-19_17-33-20.png
     
  49. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    But in the project panel the editor scripts are not actuated to the unity menu bar even the unity doco says that is what is needed.
    upload_2017-11-19_17-44-10.png

    upload_2017-11-19_17-44-37.png
     
  50. maharg

    maharg

    Joined:
    Jul 2, 2012
    Posts:
    5
    Hi,
    I've been using LeanTween for a couple of years now and am now trying out LeanTween Editor for the first time. I was wondering if there's a way to add a setOnComplete callback or somehow get a completed event without setting up a coroutine to constantly check if the gameobject has a tween on it?

    Also some minor questions:
    - Will there be support for tweening UI along a path in the future?
    - Will there be the ability to enter a transform or rectTransform in the 'to' field so objects can tween to a dynamically placed object like a ui element that's position depends on aspect ratio?
    - And this was asked earlier in this thread but the ability to sequence would be cool though I see you added the 'Align with previous' check to do that correct?.
    -Are groups in LeanTweenVisual just make complex tweens a little easier to organize? I was hoping I could have one LeanTweenVisual component with several groups that I could call play individually on but it looks like I have to have multiple LeanTweenVisual components on an object to do that. Is that the proper way to do what I want?

    I really appreciate the work you put into LeanTween. I hope you keep updating it.

    Thanks,
    James