Search Unity

DOTween (HOTween v2), a Unity tween engine

Discussion in 'Assets and Asset Store' started by Demigiant, Aug 5, 2014.

  1. polygonline

    polygonline

    Joined:
    Apr 15, 2015
    Posts:
    8
    @polygonline I was actually thinking about that, but I don't know PlayMaker. Will check some guide and see if I can make it.[/QUOTE]

    Great to hear. Thanks.
     
  2. Mr_Cad

    Mr_Cad

    Joined:
    Dec 7, 2013
    Posts:
    27
    Thanks for your reply. Just wonder is it not possible to fix that issue instead of using the workaround?
     
  3. pixlweaver

    pixlweaver

    Joined:
    Dec 21, 2012
    Posts:
    92
    Thank you!
     
  4. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @Mr_Cad That is sadly not a workaround but just the way it should be done. It's not tied to DOTween, and is simply an IEnumerator issue, which happens with any delegate created within a coroutine
     
  5. polygonline

    polygonline

    Joined:
    Apr 15, 2015
    Posts:
    8
    I have a sprite with a boxcollider on it.
    How can I play the animation, when I press on the sprite direct. Not on a seperate button. Not with autoplay.

    OnMouseDown()...................?

    I have the pro-version.

    Hope you understand the question. Thanks for your help.
     
  6. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @polygonline Here you go:
    Code (csharp):
    1. void OnMouseDown()
    2. {
    3.    this.GetComponent<DOTweenAnimation>().DOPlay();
    4. }
     
  7. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    DOTWEEN UPDATE 1.0.531
    • NEW: Added DOBlendableColorBy and DOBlendableFadeBy shortcuts to most elements that support color tweens
    • NEW: Added Material.DOFade overload which accepts a property string parameter
    • Chained settings now check for NULL tweens before continuing
    • BUGFIX: Fixed SetRelative not working correctly with some DORotate modes
     
  8. polygonline

    polygonline

    Joined:
    Apr 15, 2015
    Posts:
    8
    Thanks Izitmee

    But now I have the following message:

    NullReferenceException: Object reference not set to an instance of an object
    fisch.OnMouseDown () (at Assets/fisch.cs:10)
    UnityEngine.SendMouseEvents DoSendMouseEvents(Int32, Int32)

    Here my code:

    using UnityEngine;
    using System.Collections;
    using DG.Tweening;

    public class fisch : MonoBehaviour {

    void OnMouseDown() {
    this.GetComponent<DOTweenAnimation>().DOPlay();
    }
    }

    I do all my coding with playmaker, but I have no access to Dotween with playmaker.
     
  9. xyzw

    xyzw

    Joined:
    Sep 6, 2012
    Posts:
    9
    how to set DoTweenPath autokill false?
     
  10. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @polygonline That error means that you do not have a DOTweenAnimation attached to that gameObject. Are you attaching the fisch Component to a different GameObject than the one that has the DOTweenAnimation?
    P.S. I'm thinking of investigating PlayMaker and seeing if I can implement DOTween there, but I'm not sure when (or if) I'll be able to do it.

    @xyzw There is an AutoKill switch. If it's green autoKill is TRUE, otherwise it's FALSE.

    dotween_tmp.png
     
  11. polygonline

    polygonline

    Joined:
    Apr 15, 2015
    Posts:
    8
    Izitmee

    The DOTweenAnimation is on the right object (in this example the fisch).
    If the autoplay button ist green, I have no problems with the animation,
    but I will start the animation with a click on the sprite.
     
  12. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @polygonline That is weird: that error makes no sense unless the DOTweenAnimation and the fisch component are not on the same gameObject. Maybe there's something else going on there. Can you send me your project via private message (or a barebone replica of the issue so I can look into it)? Everything works here so I can't replicate it.

    P.S. I have PlayMaker, even if I never used it, so you can include that if you need to (as long as the attachment is private between you and me).
     
  13. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Hey Daniele,

    just wanted to know how I should tackle this one. We want to have a big ball "roll" down a mountain at a specific path.
    Now at some points we want the camera of the game, which is following the player, to shake. I do that by having a Script attached to that ball. Is there a callback for Waypoints?
    What we would need is that the ball shakes the cam at specific waypoints like the second one or the fifth one as you can see in the scene-view.

    What would the best way to tackle this? Is there a "DOTween"-Way to do this :D ?
    If not, my idea would be to create the path in the editor, retrieve the list of waypoints and check what specific waypoints the ball already passed and at the important ones I'd sent an event to the camera to shake.

    Is there a way to get to know if the ball successfully passed a waypoint already?

    DOTween.jpg

    Beyond that: when using transform.DOShakePosition() and the player is moving the camera stops and shakes and then follows the player back. Possible to shake the cam WHILE the player is moving?
     
  14. polygonline

    polygonline

    Joined:
    Apr 15, 2015
    Posts:
    8
    Izitmee

    I have done a small testproject without playmaker. If I click on the sprite, the animation don´t start.
    Autoplay works without problems.
    The script, you see on the bottom left.

    car.jpg
     
  15. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @polygonline Oh I see. You are using a DOTweenPath, not a DOTweenAnimation. In that case, change that line of code to:
    Code (csharp):
    1. this.GetComponent<DOTweenPath>().DOPlay();
    @BTStone I just updated DOTween Pro to add a GetTween method to DOTweenPath components. So you can get the path tween and then add an OnWaypointChange to it to do your bidding :)

    About DOShakePosition, if you call that while the same target/camera is moving, it will "fight" the moving tween. If you want a shakeable camera, you should add the camera to a parent, then tween the parent for paths and the child for shakes.
     
    BTStone likes this.
  16. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Awesome, will update and try it out! :)
     
  17. Antipirina

    Antipirina

    Joined:
    Aug 7, 2013
    Posts:
    18
    Oh! Thanks Izitmee! I had an old version. I was sure updating with the asset story inside Unity but it has an old version.
     
  18. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @Antipirina The Asset Store version is usually out of date: for Unity to approve a new submission it may take up to 10 days, so I do that only when I have accumulated a decent amount of changes. Remember that you can always check if you have the latest version from Tools > DOTween Utility Panel :)
     
  19. Antipirina

    Antipirina

    Joined:
    Aug 7, 2013
    Posts:
    18
    I'm wondering how to know if a tween is paused, because "IsTweening" knows if it already started, but not if it's paused.
     
  20. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
  21. polygonline

    polygonline

    Joined:
    Apr 15, 2015
    Posts:
    8
    Izitmee
    Now it works perfect. Thanks :)
     
  22. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
  23. ANTARES_XXI

    ANTARES_XXI

    Joined:
    Dec 23, 2014
    Posts:
    141
    Hello everyone! I have a problem with destroying gameobjects. So, I want to do something like that:
    Code (CSharp):
    1.  
    2. foreach (GameObject go in gameObjects)
    3. {
    4.     go.transform.DOScale(Vector3.zero, 0.3f).SetEase(Ease.OutExpo).OnComplete(() => Destroy(go));
    5. }
    6.  
    But my objects don't want to be destroyed:) They still present on the scene. OnComplete is triggered successfully.
    Maybe someone has any suggestions?
     
  24. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @ANTARES_XXI Hello magic cat! I think you're encountering this issue.

    Just redeclare your go like this and it will work:
    Code (csharp):
    1. foreach (GameObject go in gameObjects)
    2. {
    3.     GameObject redeclaredGo = go;
    4.     redeclaredGo.transform.DOScale(Vector3.zero, 0.3f).SetEase(Ease.OutExpo).OnComplete(() => Destroy(redeclaredGo));
    5. }
     
    ANTARES_XXI likes this.
  25. xyzw

    xyzw

    Joined:
    Sep 6, 2012
    Posts:
    9
    @lzitmee
    after i upgrade DOTweenPro, encounter this compiler error when i use DOTweenPath.DORestart

    Unhandled Exception: System.ArgumentException: Key duplication when adding: Void DORestart(Boolean)

    at System.Collections.Hashtable.PutImpl (System.Object key, System.Object value, Boolean overwrite) [0x00000] in <filename unknown>:0

    at System.Collections.Hashtable.Add (System.Object key, System.Object value) [0x00000] in <filename unknown>:0

    at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& Arguments, Boolean may_fail, Location loc) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Invocation.DoResolveOverload (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.If.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Foreach+ArrayForeach.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Foreach.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0

    at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.FlowBranching parent, Mono.CSharp.BlockContext rc, Mono.CSharp.ParametersCompiled ip, IMethodData md) [0x00000] in <filename unknown>:0

    (Filename: Line: 0)

    Could you help me to solve this?
     
  26. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Hi @xyzw,

    That is a very weird error. Can you check that you don't have other DOTween files other than in "Demigiant/DOTween" and "Demigiant/DOTweenPro"? Maybe you upgraded to DOTweenPro, which also contains DOTween, so you now have two of the same assemblies. Or maybe you're using some other asset which already contains DOTween (in which case keep only the one inside Demigiant)?
     
  27. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    DOTween Update 1.0.605
    • NEW: Added alternate Hyper-Compatible DOTween download, which works on all platforms including WP8.1 (while waiting for Unity to fix an internal issue)
    • BUGFIX: Fixed TweensById not working correctly with DOTween Pro ids

    About the new Hyper-Compatible version

    If you need to build for Windows Phone 8.1, Unity currently has a bug (they're working on it) which will break DOTween. While waiting for Unity to fix it, you can download the Hyper-Compatible version of DOTween, which has the same API and works on all platforms including WP8.1.
     
  28. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    I just bought Pro a little while ago and so far it is great! Thanks! I do have a few questions though (or requests if these aren't possible yet).

    1. Is there a way to wait for a collection of tweens to finish?
    Something like:
    yield return DOTween.WaitAll(DOTween.TweensById("idToWaitFor"));
    which would wait for all the tweens of the particular ID to complete before moving on.
    Ideally WaitAll would return a Tween so it can be used within a Sequence().

    2. Is there an easy way to run tweens in parallel from code and wait for them to finish? There's already a Sequence() feature and it seems like a Parallel() would be handy as well.
    Ideally, it would look something like this:
    yield return DOTween.Sequence(
    DOTween.Parallel(transform.DOMoveX(2, 2), transform.DOMoveZ(1, 1)),
    DOTween.Parallel(transform.DOScaleX(1, 1), transform.DOScaleZ(2, 2))
    );

    which would move both axis at the same time, wait for all moving to finish, then scale both axis at the same time.

    3. Regarding the DOTweenAnimation component, I had a game object with a reusable tween on it. Every time the gameobject was enabled, it was supposed to play the tween animation. I was slightly confused at first why my tween only worked the first time, even though it was set to autoplay and restart on enable. It turns out it's because of "AutoKill". Since I want to keep AutoKill on by default, I'm sure I'll run into this again sometime in the future. Would it make sense to remove the component from the GameObject when the tween is killed? Or create a brand new tween when the component is enabled and visual manager is set to "Restart" On Enable? Or maybe just a warning/error if an animation component tries to start a tween that's already killed?
     
    Last edited: Apr 21, 2015
  29. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @mdrotar Hi! I'm glad you like DOTween Pro :) Here come the answers:

    1. That seems like something particularly nasty to implement, because to truly make it work WaitAll would need to start a routine that, each time a new tween with the given ID is added, stores it in order to wait for the completion of every one of them. That would also make it impossible for it to work inside Sequences, because a Sequence needs to know immediately how long every one of its elements lasts, while instead a new "tween with ID" might be added 1 second after the Sequence has been created, thus rendering the previous WaitAll duration invalid.
    What I could do instead, is create a DOTween.TotTweensById() method, which would return how many tweens with the given ID exist, and wouldn't generate allocations as TweensById does. Then you could use that inside a custom coroutine to check when the result is 0. What you think?

    2. Actually there is. It's just that I'm an idiot and chose the worst possible name for Sequences. Because Sequences can contain tweens at any time position, both parallel and scrambled. With Join you can add a tween at the same time position of the last one you added. And with Insert you can add it wherever you want. Then as usual you add an OnComplete to the Sequence and it will fire when the whole Sequence-but-not-in-sequence ends.

    3. I will go for the easy solution (since keeping a DOTweenAnimation component there even after the tween has been killed could be useful in the future—and even now, for methods like DOPlayAllById and DORestartAllById), which is getting an error/warning when an animation tries to start/restart a component that has already been killed. If you set DOTween's LogBehaviour to Verbose (from Tools > DOTween Utility Panel), you will already get that :)
     
  30. ANTARES_XXI

    ANTARES_XXI

    Joined:
    Dec 23, 2014
    Posts:
    141
    Hello again! There are alot of DOTween calls in my demo game and sometimes I get the warning (in editor):

    DOTWEEN :: An error inside a tween callback was silently taken care of > Object reference not set to an instance of an object
    UnityEngine.Debug:LogWarning(Object)
    DG.Tweening.Core.Debugger:LogWarning(Object) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Core/Debugger.cs:26)
    DG.Tweening.Tween:OnTweenCallback(TweenCallback) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Tween.cs:265)
    DG.Tweening.Tween:DoGoto(Tween, Single, Int32, UpdateMode) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Tween.cs:247)
    DG.Tweening.Core.TweenManager:Update(UpdateType, Single, Single) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Core/TweenManager.cs:390)
    DG.Tweening.Core.DOTweenComponent:Update() (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Core/DOTweenComponent.cs:50)

    and then my editor just stucks. I can't find any reason for this issue. Wich object reference isn't set? Any suggestions?
     
  31. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Hello @ANTARES_XXI !

    That is actually an issue with your callback. What DOTween is telling you is that a callback that you fired as its OnComplete encountered an error, but DOTween managed to take care of it without crashing Unity. That said, whatever was happening in your callback didn't happen because of the error, so that's why your project might be stuck.

    "Object reference not set to an instance of an object" means that somewhere inside the code of your callback you have a NULL reference. Try checking for NULL objects, using logs (or breakpoints) inside the callbacks that might be guilty of this.
     
    ANTARES_XXI likes this.
  32. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    I was thinking just a snapshot of the tweens with the ID at the time you call TweensById(). So if a new tween with that ID is started while already waiting, it won't affect the existing WaitAll() call. Really, the feature request is for an implementation of DOTween.WaitForAll(Tween[] tweens). It's just that my particular use case right now is to wait for a group of tweens with a particular ID. A TweenByIdCount won't be useful in the other situations.

    I've already created an method to implement a WaitAll() which uses the OnComplete to let some other code know the tween is done. It's too hackish though because it needs to overwrite any previously set OnComplete callback which is bad. And it should really monitor OnKill too but that's even worse. As a different strategy, I've also tried checking each tween in the collection each frame for IsComplete but it didn't seem to work for some reason that I never did figure out. It's like some tweens never had IsComplete become true. So something integrated into your DLL will have to handle this situation.

    Actually, I'm having issues my current method for this as well. For some reason, after the first batch of tweens are done, I run another batch of tweens and the second time around I get a NullReferenceException from GetTweensById:

    NullReferenceException: Object reference not set to an instance of an object
    DG.Tweening.Core.TweenManager.GetTweensById (System.Object id) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Core/TweenManager.cs:690)
    DG.Tweening.DOTween.TweensById (System.Object id) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/DOTween.cs:846)
    DG.Tweening.DOTweenEx+<WaitAll>c__IteratorD.MoveNext () (at Assets/ImportedTools/DemigiantEx/DOTweenExtensions.cs:37)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
     
  33. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    @Izitmee

    I have a TMPro UGUI component that I am wishing to animate as a simple sequence, so I wanted to check the best way to do this.

    I have two animation scripts in sequence - one to move down (0.5 secs) and the other to move up (after 0.5secs)

    When I click AutoPlay it seems to work fine the first time when I press play.

    However on subsequent invocations I want to repeat the animations when required and I am using

    DistanceTMPro.DORewind();
    DistanceTMPro.DOPlay();

    ...however the animations do not appear. (Autoplay and Autokill are off)

    Do you know what I am doing wrong here?


    thanks,

    Nalin

    BTW the other thing that would be really useful in Play mode is to be able to change the ease function so that you can iterate and see the type of animation you want really quickly - appreciate it is not straight forward!
     
  34. xyzw

    xyzw

    Joined:
    Sep 6, 2012
    Posts:
    9
    No i don't have other DOTween file, and this error occurs only when i used DOTweenPath.DORestart(), now i use DOTweenPath.Rewind() DOTweenPath.Play() instead, no error.
    and i create new empty project import DOTween Pro package , the error still remain. Version. DOTween Pro v0.9.160..
     
  35. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @mdrotar This new update fixes the TweensById issue, sorry for that.

    About IsComplete never becoming true, can you replicate it somehow and send it to me? That shouldn't happen, unless you have recycling on (because in that case, a completed tween might have already been recycled for a new one and thus IsComplete will correctly be false).

    Taking a snapshot for WaitForAll might be doable. Let me think about that.

    @puzzlekings Grab this new update. With that, DORewind will rewind per inverse Component order, so that tweens on the same property will be rewinded correctly (as long as they're ordered "per time" in the Inspector).

    @xyzw Investigating it more now.
     
  36. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @xyzw I tried but can't replicate it: everything works here. Can you download the last version from the Private Download Area (v0.9.200), then try again and see if you still encounter this bug? And if you still do, can you send me via private-message/conversation a UnityPackage which replicates this, so I can check it out?
     
  37. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    I grabbed the update and it makes no difference. It plays once (with auto play) but I can't get it to play from code. Am I doing something wrong with

    DistanceTMPro.DORewind();
    DistanceTMPro.DOPlay();

    My component is set up with the following:

    DTPro.png

    If you have any example you can point me towards that would be good, but I have not seen one in the latest version, as most are set up via script rather than component with DTAnimation and script.
     
    Last edited: Apr 22, 2015
  38. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @puzzlekings Seeing your Inspector I realized that DORewind + DOPlay would not work correctly in your case, unless you first just play the tweens. I updated the last DOTween Pro download so that it now works even if you decide to start a tween with that: grab it here (v0.9.205).

    Also, I'm attaching a UnityPackage with an example (requires Unity 5 - and DOTween Pro obviously).
     

    Attached Files:

  39. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Hi

    Unfortunately it still did not work in my case.

    Then I downloaded your example and put it in (though I had to create/update the animation components as they were stripped out and fix any script links). When I ran it I got the cube to move on auto play first time, but then when I clicked the button the subsequent animations failed with this message:

    NullReferenceException: Object reference not set to an instance of an object
    DG.Tweening.TweenExtensions.IsInitialized (DG.Tweening.Tween t) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/TweenExtensions.cs:461)
    DG.Tweening.DOTweenAnimation.DORewind () (at Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs:297)
    DOTweenAnimationSequence_RewindAndPlay.OnGUI () (at Assets/_Examples/DOTweenAnimationSequence_RewindAndPlay.cs:11)

    Any ideas?

    N

    EDIT - ok I managed to get it to work by setting AutoPlay to off in the inspector - still shouldn't come up with those errors though ;)

    EDIT2 - actually it is still not working as expected for a couple of reasons.
    This code works (kind of)
    DistanceTMPro.GetComponent<DOTweenAnimation>().DORewind();
    DistanceTMPro.GetComponent<DOTweenAnimation>().DOPlay();
    but this does not:
    DistanceTMPro.DORewind();
    DistanceTMPro.DOPlay();

    I am expecting the latter to play all Animations in sequence / order.

    However when I use the former method, there seems to be a problem with the second animation because it jumps back to its original position as soon as it starts. Not quite sure what the problem is, but I think it may be TMProUGUI specific because the same code seems to work in the cube example you provided - i.e. the second animation does not jump when both are set to relative.

    If you can investigate that would be cool.

    cheers

    Nalin
     
    Last edited: Apr 22, 2015
  40. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Hi @puzzlekings,

    Sorry for the NullReferenceException issue. I was rushing to do DOTween support before going out and I missed that. That was actually due to the tweens been autoKilled at completion, and DORewind not using a safe-check to verify if they were null or not before applying the rewind. I updated once again DOTween Pro here with a fix :)

    About the logic, a DOTweenAnimation.DORewind (or any DO[Something]) works differently than a script shortcut, even if they share the same name. Always use DOTweenAnimation methods to control tweens created by the visual editor, because they take into account more things (like rewinding things correctly as if they were in a Sequence, even if they are not actually a Sequence).

    Instead, now I'm gonna check my example applied to a TMProUGUI element, to see what's happening.
     
  41. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @puzzlekings I experimented with TMProUGUI, but everything works correctly here. The reason why you might see that issue, is if you have the delayed DOTweenAnimation ABOVE the first one (because that would mess up the "rewinding as a sequence" order). Is that your case? If not, can you send me a unityPackage that replicates it (and by the way, sorry if the one I sent you before required you to reassign the DOTweenPro components: I was in a reeeeal hurry and wasn't polished :B)?
     
  42. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Thanks it works :)

    My bad - turns out I was calling it multiple times per update, and hence it messed everything up...

    cheers

    Nalin
     
  43. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Nice :)

    Cheers!
     
  44. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    Hello Izitmee,

    I just bought your plugin because it seemed to be the perfect fit for my projectile based games, just 5 minutes and I am absolutely blown away, the path component is going to literally save me thousand of hours of tweaking an algorithm to make a projectile look "right".

    I do have questions though, since this seems to be rather new (1 month I believe?) you mentioned there will be more updates and features, are you planning on allowing path modification in runtime? I would like to rotate the spline from a pivot point if possible, right now it seems I am able to use a parent GO to rotate the spline, which is cool and it will suffice for now.

    Thank you for your awesome tool, looking forward to see all the things I can do with it.
     
  45. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Hi @JakeTBear,

    Sorry for the late answer, and I'm glad you're liking DOTween Pro (and thanks for buying it) :)

    About future features, path modification at runtime is not one of them (neither via script nor via visual editors). A path, especially if curved, is a complex system, and is thus fixed after being created (so that only the tween itself needs to be recalculated every frame). Rotating it via its parent is certainly the most efficient solution.

    Instead, I have plans for (in random order and with a "maybe", meaning I'm not sure if I will really do these things, or instead something else):
    • A Sequence visual editor, which will allow to create Sequences (but not necessarily in a, uh, sequence) of tweens not necessarily tied to the same object. A user suggested this and I find it a good idea, but it's gonna be long: I'm already studying it but it will require some changes in the architecture of DOTween Pro
    • Various improvements to DOTweenAnimation (and maybe a new skin)
    • More animations for DOTweenAnimation (like Light color, intensity, etc)
    • More shortcuts for other external plugins
    Jumping to the conversation now.
     
  46. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
  47. ortin

    ortin

    Joined:
    Jan 13, 2013
    Posts:
    221
  48. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Yes :) Select ":: AnimationCurve" as "Ease", and a new "Ease Curve" field will appear, where you'll be able to draw your own ease using a Unity AnimationCurve.

    DOTweenPro_customEase.png
     
  49. ortin

    ortin

    Joined:
    Jan 13, 2013
    Posts:
    221
    Ah, cool. Missed somehow that SetEase accepts AnimationCurve.
    Now only need to write AnimationCurve serialization/deserialization and another TweenMax porting problem (
    Code (JavaScript):
    1. CustomEase.create("swift", [{s:0,cp:0.916,e:0.958},{s:0.958,cp:1,e:1}]);
    ) solved :)
     
  50. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    @Izitmee, It's me again :)

    I was having some issues with the Animation component. I'd like to use the Tween Animation component to run an slide-in animation on a RectTransform of a notification banner. When the notification is acknowledged, I'd like to have it slide back to where it came from off screen. I'd like to have a different ease for slide-in and slide-out and I can't get it to work with 2 Animation components on the RectTransform. Unfortunately I don't have time right now to explain in much more detail than that. I'll get you more information later.

    So I resigned myself to just doing it from code. However, I think there's also something wrong with DOLocalMoveY. It is not respecting the UI anchors. I have the RectTransform anchored to the bottom of the parent, so Y = 0 should be the bottom of the screen but instead it's putting it in the middle of the screen.