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. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    To say it with the words of Wikipedia: "To guarantee smoothness, the control point at which two curves meet must be on the line between the two control points on either side."
    Right now I can only change one single control point of a bezier path point without moving the other control point, but to get smoothness the other control point need to be moved accordingly.
     
  2. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hey Sloopi,
    After giving it some thought, I realized your "align with previous" option is a must-have. So I made the fix and it is submitted to the Unity Store. Now when you click that toggle, any change to a previous tween will fix the delay timing for that tween. Saving everyone the headache of having to go through every tween and adjust this by hand.
     
  3. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Ahhh, I get what you mean now. Hmmm that might be pretty tough to do. Just a tip, you can use the Spline path type to get an automatically smoother curve, and you won't have to worry about those hard edges (it makes it a little more complicated to achieve those hard edges though when you want them).
     
  4. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Ahhhh, music in my ears :)
     
  5. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    I didn't noticed the Spline version of a path. They are more smooth but have less control. As I know LeanTween is not a tool to make the best paths in the world (there are other third party assets already available) my question is if it could be possible to combine LeanTween with other spline/bezier packages like Curvy for example.So I can create my path with a different tool and use this data for tweening.

    (BTW: When I use Spline as path type the control sizes could not be changed)
     
  6. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Oh thanks for catching that bug about the control sizes. Yes the path editor still has room for improvement. You should be able to use LeanTween with other curve solutions. You can just tween on them using the LeanTween.value method, and assigning it a place on the path...

    I hope to keep improving the path editor though, so maybe outside packages won't be needed in the future...
     
  7. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Thanks for the hint! I'll check this solution.
     
  8. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Who would be super bummed if I made the minimum version of Unity for the Editor 4.5? I would like to be able to use these reorderable lists for the visual animation editor...
     
  9. 4ppleseed

    4ppleseed

    Joined:
    Mar 21, 2014
    Posts:
    1
    Hi DP, I've only ever used iTween so I'm used to it holding my hand on a lot of things. How do I do the iTween MoveBy in LeanTween? A continuious scroll movemment for an object, move by 1 unity per second in iTween for example is simple:

    MoveBy(GameObject target, Vector3 amount, float time)

    I'm thinking for LeanTween I need to get GameObject postion, store that as a vector3, use some type of vector3 add and then store the result as a float and then feed that into LeanTween every frame and repeat until completion? That seems so long winded to me, am I on the wrong track? Wouldn't a LeanTween.MoveBy or MoveAdd be a good addition?

    Cheers.
     
  10. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi Appleseed,
    This is pretty easy to do without using any new method, just do something like this:

    LeanTween.move( gameObject, transform.position + new Vector3(3.0f,2.0f,0.0f), 1.0f);

    Unless that is not the behavior you are after... Let me know!
     
  11. Xyyp

    Xyyp

    Joined:
    Aug 15, 2014
    Posts:
    2
    Hey DP. Thanks for your plugin, a very useful tool. I have one simple question though.
    I have an array o V3 coordinates which I capture from touchscreen move and use it to animate object with moveSpline method, but the object is not moving with constant speed (I think the reason for that is that the V3 coordinates that create the 'path' are not evenly spaced). How can I achieve a constant speed of moving object across the whole path? Maybe I'm missing something... appreciate your help. Cheers.
     
  12. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hey Xyyp,
    Thanks, I am glad you are liking the editor! How you described your use of the spline should be the correct use. I did try and make an effort to make objects move at a constant speed across the spline no matter what the spacing of the points are in between (this is actually the hardest part about implementing a spline system). However there could be be a bug. Could you send over an example of some points where you see this behavior happening?

    I would appreciate it, thanks.
    Russ
     
  13. highlyinteractive

    highlyinteractive

    Joined:
    Sep 6, 2012
    Posts:
    116
    Hi,

    I've just upgraded from 0.84 to 0.86 and the bezier structure seems to have changed - I'm getting errors about supplying the correct number of control points.

    Is there a correct way to migrate?

    Perhaps along with the export tool you could create a tool to import a valid array?
     
  14. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Oh no, sorry to hear you are getting an error. I did get something briefly that was similar, when I was going through my testing, but all my other bezier paths were working correctly, so I thought I had just wrecked that path earlier. Anyways sorry about that.

    I was actually planning on making an import feature for another project I was working on that is using the path editor from ages ago (pre-asset store, so it wouldn't be compatible). I will try and get on that ASAP and get you over a version of the update...
     
  15. highlyinteractive

    highlyinteractive

    Joined:
    Sep 6, 2012
    Posts:
    116
    Awesome, thanks :)

    I think it would be a nice addition to the Editor
     
  16. Xyyp

    Xyyp

    Joined:
    Aug 15, 2014
    Posts:
    2

    Hi DP, sorry for late reply but been away for few days. I managed to make it work by capturing only evenly spaced points (by measuring distance from the last one to the next and then multiplying tween time by number of points). So it seems to work fine now, but my bigger problem/question at the moment is:

    Is it possible to update the tween with new coordinates 'on the fly'? In other words: if I passed my array of points as a parameter and the tween has started, but my path is still being drawn and new points are added to it can I somehow pass it to the tween so it animates seamlessly? Many thanks for your help.
     
  17. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Support for Unity’s new UI continues to improve in the latest LeanTween (more features, and more testing for stability). The latest LeanTween Editor features a new space themed ui skin that demos a lot of the LeanTween UI animation features.

    The whole scene was done using only code generated from the editor (not having to write code can feel pretty liberating, great for prototypes or simple scenes). View the space ui scene running in WebGL (running with Unity5′s WebGL). A neat random fact, this runs on an iPad browser! (but only in Chrome, Safari runs for about 3 seconds before crashing)



    Futuristic space skin is included in the editor update

    Some other exciting new additions to the LeanTween API:

    LeanTween.play (canvas sprite animations)
    Animate the image ui item (UnityEngine.UI.Image) directly with LeanTween.
    example: LeanTween.play(RectTransform rectTransform, Sprite[] sprites).setFrameRate(6f);

    rotateAroundLocal (canvas)
    Because sometimes you want to rotate the RectTransform in local space

    The other ones that have been around for awhile: move, scale, rotateAround, alpha, color(all specifically targeting the new RectTransform object).
     
  18. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hey Xyyp,
    I am glad you got it working. Unfortunately there isn't anyway to easily append new items onto an existing path. However you could just have on the onComplete on the current path animation, put code in there to then create a new path segment that starts at the current point. I know that is probably not what you are looking for, but it could work...
     
  19. dentedpixel

    dentedpixel

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

    There is now an import feature to the LeanTween Editor. I hope it works for your needs! I know I am excited to upgrade that old project of mine to the newest bezier system :)
     
  20. NeonXX

    NeonXX

    Joined:
    Mar 13, 2014
    Posts:
    4
    Hi DP,

    I bought your LT Editor a while ago and I'm using it for Sprites objects (2d) moving on Spline paths.
    Earlier, when I SetOrientToPath2d(true), the objects will face the correct direction when moving.
    After I updated to your latest LeanTween 2.241 via Unity Store, all my objects are facing to their left while moving along the paths.

    I'm designing a 2d vertical shooter. So, all my sprites are facing upward.

    I could rotate all my sprites 90 deg clockwise but that will be tedious.
    Is there some settings I can tweak to change their facing direction while moving along the splines?

    Otherwise, LT and LT editor are awesome products. I don't regret purchasing the editor.
    Thank you.
     
  21. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hey NeonXX,
    Sorry for breaking that functionality, it was sort of necessary to get everything in working order. Unfortunately the only way to fix it is to rotate the images themselves like you mentioned, or you could put the sprites themselves inside a container empty sprite, and then rotate the child sprite 90 degrees to face the right direction inside the parent. I know that's not an optimal solution, I had experimented with a way to set the orientation manually, but it was not working correctly. I will hopefully have a better solution in the future, but that is how it is for now :-/

    I am glad you are liking my tools otherwise :)
    Best,
    Russ
     
  22. NeonXX

    NeonXX

    Joined:
    Mar 13, 2014
    Posts:
    4
    Ok, I understand.

    Thanks DP.
     
  23. Toonsylvania

    Toonsylvania

    Joined:
    Jun 1, 2010
    Posts:
    29
    Hi,

    I just wanted to share a few ideas that would help improving the workflow for some of us...

    1- A color selector to change the path color, instead of the mandatory magenta, would be helpful to differentiate paths easily.
    2- A toggle to automatically close/unclose the current path...
    3- Another thing currently lacking is the ability to insert nodes. I mean, you can add nodes but always after the last one. It would be great to be able to add a node just after a selected one.
     
    Last edited: Mar 6, 2015
  24. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    Hi,
    I just bought the editor as a Thank you for making this awesome tween engine!
    Leantween now is a core part of my framework, I am using it for Camera movements, Waypoint system and also for moving gravity. Arigato gozaimasu! Thank you very much.
    I am also helping a bit on Github, which is a first for me.
     
  25. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Hi. Just bought this. One issue I've come across. When adding new points using the LeanTween Path Control Script I repeatedly get the error '
    MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.


    Have many suggestions for improvements but the first thing that comes to mind is a checkbox to enable-disable splitting of control paths... so the path thru any node will be seamless

    Also when you move nodes by selecting them first in the hierarchy, the associated control points should move with the node.
     
    Last edited: Sep 13, 2015
  26. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hmmm, do you know how you got it to start throwing this error? I don't see this error in the normal workflow, but there may be a bug, where you delete a node in the heirachy window and not through the bezier editor. Sometimes when things go wrong in the path editor it can be all cleaned up if you hit the "refresh" button. Although it's always best to avoid the bug in the first place if you can remember the sequence of steps you did to get that error to come up.
     

    Attached Files:

  27. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Thanks, guessing that is what may have happened. Will remember to delete only using the editor. Another issue I am having is 'bumps' in the motion at my nodes. Guessing this has something to do with control points not lining up? Can you suggest an easy solution? This is really a 'show stopper' for me.


    Also had one more question

    Is there an easy way to orient the camera so that it is always perpendicular to the path (in either the x, or z axis)?
     
    Last edited: Sep 13, 2015
  28. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Yeah you can switch to the "spline" method of animating along a set of points instead of bezier, it is easier to get a smooth path, but a little harder to get the exact shape you might want (at least in my opinion).

    For orientating to the path you just want to make sure to set the setOrientToPath( true ) for the tween. Unfortunately it always faces in a set direction, if that is not the direction you need simply make a parent gameObject for the camera, where the parent follows the path, and then you can rotate the camera to an arbitrary rotation within it's parent object...
     
  29. MarcelEl

    MarcelEl

    Joined:
    Sep 1, 2014
    Posts:
    2
    Hi,
    Most of the time, but not every time, I get the following error when I stop Unity and used LeanTween before:
    Some objects were not cleaned up when closing the scene. (Did you spawn new GameObjects from OnDestroy?)
    And a reference to the ~LeanTween game object with the attached script, stay in the hierarchy.

    Is this a known behaviour?

    Thanks
    Marcel
     
  30. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi Marcel,
    That isn't known behavior that I have seen before. Awhile ago there was some trouble with the ~LeanTween object staying around, but I thought it had been taken care of for awhile. Can I ask which version of Unity you are using? Are you doing any tweening on OnDestroy? A sample project with this error would be great, if it's possible to isolate the problem to something you can share...
     
  31. AntoninL

    AntoninL

    Joined:
    Nov 2, 2015
    Posts:
    5
    Hi,
    I have the exact same issue on Unity 5.2. Every thing was fine yesterday, I stopped Unity and today the exact same code without any change produces this error. Did you solved this bug ?
     
  32. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi AntoninL,
    Unfortunately I haven't fixed the bug yet, but now that i know it's reproducible I will look into it. Do you happen to be using the Path Editor in the scene it produces the error in? I am thinking that might be at the root of the problem...
     
  33. AntoninL

    AntoninL

    Joined:
    Nov 2, 2015
    Posts:
    5
    Hi DentedPixel,
    I'm using only LeanTween without Editor part. Bug starts to happen when I've destroyed an object with setDestroyOnComplete. ~LeanTween object remains in scene even after tween so when you close application it causes a bug and happen again and again at next start. Now it continues to happen even if I don't call LeanTween on each scene of my game.
    Thanks.
     
  34. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi AntoninL,
    I am unfortunately not able to reproduce that bug. Is there any way you could provide a project or a code snippet that recreates this error? That would be a big help. What version of Unity and target platform are you using?

    Thanks,
    Russ
     
  35. AntoninL

    AntoninL

    Joined:
    Nov 2, 2015
    Posts:
    5
    Hy Russ,
    I also tried to reproduce bug in another project but with the same code I'm not able to reproduce it :/ I don't know why it's happen in my main project. I will try to erase LeanTwean completely from my project and try to reimport it.
    I'm targetting Android for now and using Unity 5.3.2.
    Thanks.
     
  36. AntoninL

    AntoninL

    Joined:
    Nov 2, 2015
    Posts:
    5
    Hi,
    Ok I found why I've got this error... :/ I had an error in my code and sometimes LeanTween was being called on the same object at same time and was destroying it during one of them. After that LeanTween didn't work until we erase Library directory and restart Unity.
    Thank you.
    Antonin.
     
  37. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Ok thanks that is a good lead. I suspect things may have gotten corrupt after that runtime error, I am going to try and recreate this and see if I can come up with a solution that will not cause the Unity project to break like you described.
     
  38. dentedpixel

    dentedpixel

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

    I have fixed what I think is likely the error that was causing your issues. I was able to get a runtime error following your description of two destroyOnComplete's of the same object, but it never made my Unity corrupt, or left at ~LeanTween around in the scene after stopping. But hopefully it will fix that issue for you. The latest code is on github: https://github.com/dentedpixel/LeanTween (The LeanTween.cs file has been split up into a couple more files, so you would want to copy over all the *.cs files in the Plugins folder).

    Thanks!
    Russ
     
  39. SarahLee

    SarahLee

    Joined:
    Sep 6, 2014
    Posts:
    2
    LTBezierPath ltPath = new LTBezierPath( new Vector3[] { new Vector3(0f,0f,0f),new Vector3(1f,0f,0f), new Vector3(1f,0f,0f), new Vector3(1f,1f,0f)} );

    i want to know what the 4 parameters mean ,which one is the statPoint ,which one is end point ,which one is the startPointTangent ,which one is endPointTangent?
     
  40. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi SarahLee,
    I realized I didn't have adequate explanations for this class in my documentation, so I have updated it: http://dentedpixel.com/LeanTweenDocumentation/classes/LTBezierPath.html

    Please let me know if you still have any questions regarding the points.
     
  41. KEMBL

    KEMBL

    Joined:
    Apr 16, 2009
    Posts:
    181
    Hi DentedPixel,
    Thank you for the good piece of code! I am using LeanTween Editor in that way:
    I have created LeanTweenVisual components and enable/disable them in necessary order.

    For example, at the attached picture, I have set a group inside a LeanTweenVisual component which allows UI window to arrive on the screen with several other sub-actions along the way.

    Now I need to push that window out along the same way. How could I reverse group playback?

    I know that LeanTween object has setDirection method, but it seems there is no the same method for the
    LeanTweenVisual.groupList or LeanTweenVisual.groupList.itemList objects.

    Please give a piece of advice.
     
  42. KEMBL

    KEMBL

    Joined:
    Apr 16, 2009
    Posts:
    181
    Sorry, I forgot about the picture!
     

    Attached Files:

  43. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi Kembl,
    There is no easy way to reverse the whole group at once unfortunately :-/

    However you can check off the "loops" value and set it to PingPong, to have it all the tweens reverse their direction and return to their beginning spot once they first complete.
     

    Attached Files:

  44. KEMBL

    KEMBL

    Joined:
    Apr 16, 2009
    Posts:
    181
    Thank you for the answer,

    after I having applied suggested actions (loops) the result was funny but not expected)))

    well, the best solution that I found is to make second LeanTweenVisual with actions in reversed order and with reversed parameters, that works just fine!)

    Thank you again, I hope you will add reversing for the groups one day, that will reduce designer's time twice for similar tasks.
     
  45. amrakdab

    amrakdab

    Joined:
    May 23, 2013
    Posts:
    13
    Im animating a plane object along a path and want to align it to path, which works great, but when it changes direction, the transform flips and becomes invisible. Can I stop the flipping?
     
  46. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    It seems like you want it to have more 2d behavior, I would use the setOrientToPath2d method like:

    LeanTween.move( ltLogo, path, 1.0f ).setEase(LeanTweenType.easeOutQuad).setOrientToPath2d(true).setAxis(Vector3.forward);

    I hope that helps!
    Russ
     
  47. glowe

    glowe

    Joined:
    Jun 10, 2014
    Posts:
    68
    I just got your editor - it looks very cool! I got Cinema Director a while back. It looked flashy and powerful, but I was rather disappointed that it's rather bulky, buggy and limited. And their answer to a simple fix I suggested was to throw it on the their roadmap. (Yeah, they'll probably just forget about it for another 6 months...) Your Tween and Editor assets are clearly amazing and can do the 10 times worth of basic stuff the Cinema stuff lacks. Well, you don't have a timeline editor, but since I ended up with both tools I can finally create some proper cutscenes. I would totally suggest trying to make a timeline editor for your api if you're ever so inclined. It would rock and probably be 10 times better than what's currently out there...

    Anyway, I'll try to play around with your editor and api in the next few days - I mainly looked around at the test scenes so far. I did notice a few things I'd recommend:
    1. maybe group the files of your Plugin folder in a subfolder. That way things stay organized if people end up with other 3rd party plugins (I haven't yet, but figure it will happen some day.)
    2. add namespaces to c# stuffs if it doesn't interfere with the js stuffs. it's just better to not run into class name conflicts some day... I think...
    And, thanks a lot for making these tools and presenting all videos and performance tests. It's clear that you're making a superior product and you know what you're doing!
     
    Last edited: Jul 22, 2016
  48. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Thanks a bunch Glowe! I had thought about doing a timeline editor version of the visual editor, but it would really only be a different view of what you can do with the visual editor, it would just make the delays more apparent, unless you can think of other ways it would be improved... Still thinking about this as an option though, I am just trying to be aware of what would be gained.

    1. Grouping it into a folder sounds like a good idea, I don't think this was an option in the earlier 4.x Unity's but it should be an option now, and it would make it less messy for sure. I'll look into this for the next release!

    2. This is a good idea, and has been mentioned by another developer or two, most everything is prepended by LT or LeanTween so it's not at too high of a risk of conflicts, but it is better to do this if it doesn't interfere with JS stuff.

    Thanks again for the feedback!
    Russ
     
  49. glowe

    glowe

    Joined:
    Jun 10, 2014
    Posts:
    68
    You're killing me Russ - talking like "LeanTween ... primarily is a tool designed for programmers." :p Yeah, I guess what I mean might jump out a little better with some images. Well imagine if your animation Visuals looked more like the second image. That's a timeline that has various things that you can drag around. As you move stuff around, yeah, all it does is change one or two values of some component somewhere else. But, being able to manipulate that stuff in a timeline is a lot easier to visually keep track of than looking at a big list of numeric values in the inspector. Also, that's how most people are used to animating in other programs: Maya, 3DSMax, Blender, Premiere, Flash, and even Photoshop. I think that's what people will generally expect and try to look for when they search for animation solutions. (Still, your product is turning out to be way more capable under the hood than the clunky timeline product I'm using - I think you've made the jquery of Unity tweens. Unfortunately, the timeline product I use does not really work like the products described above - it only looks like it does.) So, if you have a tool that works in a way people are already used to, powered by your great library - well, it seems like a no brainer. Since you've been nice enough to open source LeanTween, I'd be pretty interested in making something like that, but I couldn't really start any time soon as I'm very busy for the next few months working on a game I want to release on Steam... (it's about the dragon in the pics.) :)
     

    Attached Files:

  50. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Nice! That game looks like it will be a good one. Yeah I understand the benefit from a familarity standpoint. I used to do a lot of flash work and I would like it if it was a similar layout. Hopefully I can get to that soon, but at the moment I am working on my game too (with occasional LeanTween updates). I am working a game titled Screaming Meats :)