Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

DOTween (HOTween v2), a Unity tween engine

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

  1. DanielVanches

    DanielVanches

    Joined:
    Apr 19, 2012
    Posts:
    38
  2. xiaomaza

    xiaomaza

    Joined:
    Apr 4, 2015
    Posts:
    9
    Hi,My version is Unity3d5.3.1,The following error occurred: Error.jpg
     
  3. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,233
    @xiaomaza Hi! That is an error that appeared in the first Unity 5 versions, but is now resolved in 5.3. It's a Unity bug, but you can just ignore it and everything will work correctly.
     
  4. Lasse-Loepfe

    Lasse-Loepfe

    Joined:
    Mar 28, 2014
    Posts:
    25
    Hi,

    congratulations for a very handy product. I just wanted to propose some features that would make my life even easier:

    1) negative delay values, so that the object would start mid-way
    2) Random ranges, especially for duration and delay
    3) single axis movements, if I want to move an object only on the x axis, avoid the need to specify y and z end points

    Best
    Lasse
     
  5. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,233
    Hi!

    Glad you like it :)

    1) Instead than using delays, in that case you can simply use Goto([mid-point-value])
    2) Isn't Unity's Random.Range function already useful enough?
    3) It's there: you can use DOMoveX/Y/Z :)

    Cheers,
    Daniele
     
  6. Lasse-Loepfe

    Lasse-Loepfe

    Joined:
    Mar 28, 2014
    Posts:
    25
    Hi,

    thanks for the quick answer.
    I was suggesting it for the editor, to avoid touching code on lazy mondays ;)
     
  7. xiaomaza

    xiaomaza

    Joined:
    Apr 4, 2015
    Posts:
    9
    Hi,thanks for the your answer,
    but this error is always appear on the mac system, and can not run in edit mode,it can not ignore.
     
  8. JobeLloyd

    JobeLloyd

    Joined:
    Sep 19, 2012
    Posts:
    3
    I get this error trying to set up easing functions:

    'DG.Tweening.Tweener' does not contain a definition for 'SetEase' and the best extension method overload 'DG.Tweening.TweenSettingsExtensions.SetEase<T>(T, DG.Tweening.EaseFunction)' has some invalid arguments

    This is the line of code:
    this.transform.DOMove(new Vector3(0, 0, 0), 1f).SetEase(Ease.OutSin);
     
  9. JobeLloyd

    JobeLloyd

    Joined:
    Sep 19, 2012
    Posts:
    3
    aaaand i found the cause. Looks like namespace collision with another package(SplineEditor) that defines a class "Ease"
     
  10. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    726
    @Izitmee Hey Daniele, I'm trying to delay a looping sequence (I want to wait a certain time before the looping sequence starts) but I can't seem to work it out. I've tried this:

    Code (CSharp):
    1. Sequence mySequence = DOTween.Sequence();
    2. mySequence.Append(myTransform.DOLocalRotate(pendulumAxis, pendulumDuration, RotateMode.LocalAxisAdd).SetEase(Ease.InOutQuad)).SetLoops(-1, LoopType.Yoyo).SetDelay(1f);
    But all it does it add a 1 second pause at the end of each loop, instead of delaying the execution of the sequence itself by 1 second. Any idea about what I'm doing wrong?
     
  11. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,233
    @Seith Hey!!! What you did there, practically, is that you set your nested tween to start after 1 seconds, then set the whole Sequence to loop infinitely. Since the delay is contained inside the Sequence, it will repeat at every loop.

    To be honest, there is no "direct" way to add a delay to a Sequence, since with Sequences SetDelay just behaves as if you used Insert(1...) instead of just Append. You could use one of these tricks though:

    1) Use Insert(1...) directly instead of append, then set the loops on the nested tween instead than on the Sequence. One note of advice though: since nested tweens don't support infinite loops, you would have to set them to something like Int32.MaxValue.
    2) Create the Sequence without any delay, and use DOVirtual.DelayedCall to start it.
    3) Not create a Sequence at all, since you're just tweening a single target there. With regular non-nested tweens, SetDelay works exactly as what you have in mind.

    @xiaomaza Uhm, weird. What version of DOTween are you using? Could you try the latest version from here?

    @Lasse Loepfe Ah, sorry! I always assume we're talking about the runtime API unless specified. I'll think about point 2, but that might be a nono, but point 1 and 3 look interesting. Adding them to my todo list :)
     
  12. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    726
    Ah silly me, it's true I don't need a sequence in this case! But that's good to know, thank you! :)
     
  13. Siegfried

    Siegfried

    Joined:
    Dec 10, 2012
    Posts:
    7
    hello, I have a problem: I have a tween that runs for some time (platform), I would like to know what is its position gonna be in the future, ie in 2 seconds from now. how to do it? best regards
     
  14. plokkum

    plokkum

    Joined:
    May 28, 2013
    Posts:
    78
    Hi there! This is my first time using DoTween and I'm loving it so far. Such a great performance and it is such a great tool for my current 2D game. Thanks a lot!

    Anyway, I have a GameObject that loops its x-position using transform.DOMoveX().SetLoops(-1)
    When I want to stop the animation after it completed its current loop-iteration, I try to kill it with transform.DOKill(true). The animation stops, but exactly at the moment when DOKill(true) is called. Shouldn't it stop the animation after it completes its current iteration?

    Thanks!
     
  15. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    @plokkum Well, no, not really :(

    When you tell it to kill it, it will do it instantly. What you want to do is to check everytime the loop happens if it should stop or not. Check if the tween needs to be killed inside a "OnComplete" callback:
    transform.DOMoveX().SetLoops(-1).OnComplete(() =>
    {
    //check here for your own conditions
    });

    Hope this helps :)

    Edit: Forgot to mention, you will have to cache your tween before giving an OnComplete callback, otherwise you dont have a way to know which tween to stop, sorry for that!
     
    Izitmee and plokkum like this.
  16. plokkum

    plokkum

    Joined:
    May 28, 2013
    Posts:
    78
    Thanks for the help, @JakeTBear!

    I assumed that the OnKill's bool parameter was supposed to kill the animation after it was completed. But your solution should do the trick.
     
  17. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,233
    I bow to @JakeTBear's solution! And about the bool parameter in Kill/DOKill, it doesnt' wait for the tween to complete: it forces the tween to complete immediately and then kills it.
     
    plokkum likes this.
  18. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,233
    @Siegfried Hi! You could send your tween to 2" (using Goto), check your target's position, then send the tween back and let it continue running as usual.
     
  19. plokkum

    plokkum

    Joined:
    May 28, 2013
    Posts:
    78
    Just to add to your suggestion, @JakeTBear, in order to check conditions after each loop,OnStepComplete() should be used. OnStepComplete() fires after each loop iteration.
     
    JakeTBear likes this.
  20. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    @plokkum Yep! you are absolutely right :)
     
  21. dogfacedesign

    dogfacedesign

    Joined:
    Jan 10, 2016
    Posts:
    70
    Hi everyone! Pulling my hair out here .... not sure if there is a solution for this or not. Thanks for your patience in advance, as I am still learning Unity.

    Basically I have a sharedMaterial that I want to fade out, while I simultaneously fade a new one in. I've tried all sorts of things, but no love. I can get them to "switch out", with no problems, but I really want this fade effect. Any suggestions or ideas would be greatly appreciated!!

    Cheers.
     
  22. fastgamedev

    fastgamedev

    Joined:
    Mar 27, 2014
    Posts:
    91
    Bug Report:

    DOTween Pro v.0.9.470

    The OnPlay event in DOTween Animation script honors the Delay Value only for the first play, and ignores it for all subsequent ones.
     
    Last edited: Feb 6, 2016
  23. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,233
    @dogfacedesign Hi! There is no way to crossfade materials in Unity (unless they're on different objects), but you could use a single material and fade one texture to another. I made an example here a while ago.

    @fastgamedev Hi! That is actually by design. In tweens, a delay is always something that is not part of the tween itself, but just delays the startup. It can be used again though, if you use DORestart on your DOTweenAnimation, which restarts the tween including delays.
     
  24. fastgamedev

    fastgamedev

    Joined:
    Mar 27, 2014
    Posts:
    91
    @Izitmee Thanks for quick response! Yes, that's exactly where the bug is. I use DORestart to restart the tween with a delay, and the tween *does* restart with a delay, so that's working correctly. However, the event OnPlay is fired after the delay for the first play of the tween (correctly), and right away (ignoring the delay) for all subsequent plays of the tween (incorrectly). This might help explain it better:

    If I have a tween with delay 1 and duration 3, then:

    at t=0, call DORestart
    at t=1, tween starts playing
    at t=1, OnPlay is fired
    at t=4, tween ends playing
    ...
    at t=10, call DORestart
    at t=10, OnPlay is fired <---- this is incorrect, should be fired at t=11.
    at t=11, tween starts playing
    at t=14, tween ends playing

    Also, from the docs, DORestart(true) should include the delay, and DORestart(false) should not. For me, they both include the delay.
     
  25. SoulGameStudio

    SoulGameStudio

    Joined:
    Jan 18, 2016
    Posts:
    44
    Hi there, first of many thanks for that awesome library.

    I'm stuck using generic DOTween with Spine animation engine, my goal is to tween the Alpha properties of my characters parts. It's quite simple:

    Code (CSharp):
    1. ExposedList<Slot> slots = skeletonAnimation.skeleton.Slots;
    2. for (int i = 0; i < slots.Count; i++) {
    3.     Slot slot = slots.Items[i];
    4.     DOTween.To(() => slot.A, x => slot.A = x, 0, 1); // nothing happens
    5. }
    (I arbitrary tested "slot.A = 0.2f;" in the for loop, and it works, the character is actually transparent.)

    There is no compiler error and slot.A do have get/set methods. Any leads about that ? Or does it mean I can't tween that property using DOTween?
    Thanks for your time!

    P.S: page 42 \o/
     
    Last edited: Feb 9, 2016
  26. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,233
    @fastgamedev Ouch damn! Then that's a bug indeed! Gonna investigate it immediately!

    P.S. DORestart has an optional delay parameter when called from a Tween/Tweener/Sequence, but when called from a DOTweenAnimation/Path always includes the delay.

    @SoulGameStudio As long as a property can be changed via code, it can definitely be tweened with DOTween. Maybe there's something else that is resetting the values after each frame? Can you try attaching an OnUpdate call to your tween, and use it to check if slot.A is actually changed? If yes, then something resets it after DOTween updates it.

    P.S. A Douglas Adams reference! That makes me so happy \o/
     
    SoulGameStudio likes this.
  27. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,233
    @fastgamedev Fixed! :) I'm attaching the last DOTween version. Just replace your DOTween (not DOTween Pro) folder contents with the ZIP ones, then run the Setup as usual.

    P.S. What I wrote about DORestart before was wrong (DOTween's API has a lot of stuff, and sometimes I forget it too). All DORestart methods have the same parameter, but it's optional. So if you don't write anything there it's taken as TRUE and the delays are taken into account.
     

    Attached Files:

  28. SoulGameStudio

    SoulGameStudio

    Joined:
    Jan 18, 2016
    Posts:
    44
    @Izitmee : Thanks for the answer! I traced the slot.A value in OnUpdate => they all stay at 1 except for one, which is tweening properly (it's a small part, I didn't notice it before my bad). The tween which works is precisely the one in the last iteration of the for loop. Would it be possible than the previous are override/erased?

    [SOLVED] EDIT:
    Oh my... Previously I compacted the code for the sake of the Forum clarity. But in my actual code, I had the slot variable declared before the for loop (good practice you know...) like this:
    Code (CSharp):
    1. Slot slot;
    2. for (int i = 0; i < slots.Count; i++) {
    3.     slot = slots.Items[i];
    4.     DOTween.To(() => slot.A, x => slot.A = x, 0, 1);
    5. }
    I guess DOTween was indeed overriding the target each time. It works now! Sorry for the bother.
     
    Last edited: Feb 9, 2016
  29. joegatling

    joegatling

    Joined:
    Jul 16, 2013
    Posts:
    6
    DoPath.png

    I am seeing a performance spike when using DoPath() for the first time. If you look at the image above, you can see that on the first run it takes 2ms to complete, but on the second call it only takes 0.05ms. I am guessing that initializing the Catmull-Rom converter is expensive.

    I have tried calling DOTween.Init(), but it doesn't seem to make a difference.

    Is there a way to initialize the path plugin without making a dummy DOPath call?
     
  30. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,233
    @SoulGameStudio Glad you solved it! And yes, declaring the variable outside creates an issue that is related to the old NET implementation of Unity (this issue).

    @joegatling Hi! While DOTween.Init initializes the engine, each plugin is indeed created and initialized only the first time it's used. The best way would be to create that path at startup and keeping it paused, then call ForceInit to force its initialization before it starts.
     
    joegatling likes this.
  31. Sonoshee

    Sonoshee

    Joined:
    Jul 8, 2014
    Posts:
    77
    Hi there! I started a new project last time and updated DOTween; I can see you added the Flash ease type. I can't find any reference to it on the internet, can you link me to its easing curve?
    Thanks a lot btw for this awesome tool!
     
  32. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,233
    @Sonoshee Hiya! The Flash ease is a custom ease that I created myself. You can find more about it here, under Special Eases (I'm also linking the gif here, just for the sake of it ;)).

     
  33. Sonoshee

    Sonoshee

    Joined:
    Jul 8, 2014
    Posts:
    77
    Oh cool! Just found a usage for this Flash ease in my game, it's the transparency flashing after the aircraft is hit:

    ( excuse the low frame-rate)
    Cheers.
     
  34. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,233
    Niiice!!! Gonna spam it on twitter :)

    By the way, a nice (but tricky, because it can be horrible in some cases) usage can be also with some audio FX when fading them out/in ;)
     
  35. Sonoshee

    Sonoshee

    Joined:
    Jul 8, 2014
    Posts:
    77
    Haha thanks. I will try it with audio sometime today, sounds like a neat idea!
    I don't know how my life could have been without this library, I literally use DOTween more than I drink water. So thanks again :)
     
  36. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,233
    Glad to hear it, but maybe you should drink more water then :D
     
    Sonoshee likes this.
  37. CGPepper

    CGPepper

    Joined:
    Jan 28, 2013
    Posts:
    140
    [Edit: solved my own problem, i can call re-wind on a gameObject]
    If i want to re-use an animation, do i always have to call Restart? (created in the inspector window) I have a menu where you can go back and forth. The first time i call an animation i use DOPlayById. If i want to use it a second time, i have to call RestartById. This results in a very messy code. Can i re-enable DOPlayById?

    What is the best way to stop a tween animation while its playing but keep it re-usable?
     
    Last edited: Feb 12, 2016
  38. SidarVasco

    SidarVasco

    Joined:
    Feb 9, 2015
    Posts:
    163
    Finally got time to get to my project and I still have the issue of objects going slow.

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using DG.Tweening;
    4.  
    5. public class Spikes : MonoBehaviour {
    6.  
    7.     public float InitialDelay = 1;
    8.     public float ExpandDelay = 2;
    9.     public float ExpandSpeed = 0.1f;
    10.     public float RetractDelay = 2;
    11.     public float RetractSpeed = 2;
    12.  
    13.     Sequence s;
    14.     // Use this for initialization
    15.     void Start () {
    16.        s =  DOTween.Sequence();
    17.         s.Append(transform.DOMove(transform.position + new Vector3(0, 0.1f, 0),0.1f).SetDelay(InitialDelay));
    18.         s.Append(transform.DOMove(transform.position + new Vector3(0, 1, 0), ExpandSpeed).SetDelay(ExpandDelay));
    19.         s.Append(transform.DOMove(transform.position - new Vector3(0, 1.1f, 0), RetractSpeed).SetDelay(RetractDelay));
    20.         s.SetLoops(-1, LoopType.Restart);
    21.        
    22.     }
    23.  
    24. }
    25.  
    26.  
    Just drag and drop this on your game object and you will see it goes slower and slower every time.
     
  39. D3ntrax

    D3ntrax

    Joined:
    Mar 21, 2014
    Posts:
    35
    @Izitmee

    Hello!

    I have a sample script coded with HOTween plug-in.

    In HOTween, I can do the following:

    1) HOTween.To((targetPiece.Bottom.Tile as DestructionTile).tileModelTransform, fallStiffness, new TweenParms().Prop("localPosition", Vector3.down * fallPower).Ease(EaseType.EaseOutSine));

    2) HOTween.To((targetPiece.Tile as DestructionTile).tileModelTransform, fallStiffness, new TweenParms().Prop("localPosition", (targetPiece.Tile as DestructionTile).tileModelLocalPos).Ease(EaseType.EaseOutSine));

    3) HOTween.Init(false, false, false);

    What is the equivalent in DOTween? There is no To extends keyword apparently and this does not work:

    DOTween.To, DOTween.DOMove (There is no Prop function)

    Thanks so much...
     
  40. SidarVasco

    SidarVasco

    Joined:
    Feb 9, 2015
    Posts:
    163
    @Furkann

    Not sure what you are after but you provide the property you want to target

    Either use the DoMove on the transform directly or use the generic DOTween.To as:
    Code (csharp):
    1.  
    2. DOTween.To(()=> MyTransform.localPosition, x => MyTransform.localPosition = x, TargetDestinationVector, Time);
    3. //You can use the dot operator like the .Prop in HOTWeen to add additional settings
    4.  
    DOTween extends transform with extra tweening functions. Which doesn't use the lambda expressions. try typing transform.Do
     
    Izitmee likes this.
  41. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,233
    @CGPepper Glad you solved it. Consider also that, as long as you SetAutoKill(false) on a tween, it is always reusable until you kill it manually, and you can Pause, Goto, Rewind, Restart it as many times as you want.

    @Furkann Here you go (hope I didn't forget any parenthesis:
    Code (csharp):
    1. // 1
    2. (targetPiece.Bottom.Tile as DestructionTile).tileModelTransform.DOLocalMove(Vector3.down * fallPower, fallStiffness).SetEase(Ease.OutSine);
    3. // 2
    4. (targetPiece.Tile as DestructionTile).tileModelTransform.DOLocalMove((targetPiece.Tile as DestructionTile).tileModelLocalPos, fallStiffness).SetEase(Ease.OutSine);
    5.  
    3) Check out DOTween.Init

    @SidarVasco Agh, I was answering in a sequence and didn't notice you answered already. Thank you sir! :)
    P.S. Now that I answered the easy question I'm going to check your code.
     
    D3ntrax likes this.
  42. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,233
    @SidarVasco I replicated your code, and added an OnStepComplete callback to check the duration of each loop step. After 22 repetitions, the step time is constant (7.19N seconds), and I see no slowdowns. This makes me think there must definitely be something else happening in your project. Can you replicate your issue in a barebone example project? And if yes, please send it to me so I can check it out.
     
  43. SidarVasco

    SidarVasco

    Joined:
    Feb 9, 2015
    Posts:
    163
    Ill try that. It's weird though because my project is pretty much barebones. But when i get home ill try again in a clean project.

    FYI I did reset the setup, but that didn't work.
     
  44. Dragonic89

    Dragonic89

    Joined:
    Jan 3, 2013
    Posts:
    48
    Hello,

    We just found maybe a bug with a friend, between DOTween.Init and Time.captureFramerate !

    Example test, just moving a uGUI image within 5 seconds :

    Code (CSharp):
    1.  
    2. public Transform image;
    3.  
    4. void Start () {
    5.  
    6.         //first and only script of the example
    7.  
    8.         Time.captureFramerate = 10;
    9.  
    10.         DOTween.defaultTimeScaleIndependent = true;
    11.  
    12.         image.DOLocalMoveY(-450,5);
    13.  
    14.     }
    Problem : with this code, the animation is too fast (~1 second).

    We also found a weird fix :

    Code (CSharp):
    1.  
    2. public Transform image;
    3.  
    4. void Start () {
    5.  
    6.         //first and only script of the example
    7.  
    8.         Time.captureFramerate = 10;
    9.  
    10.         DOTween.Init();//can be called before or after "captureFramerate" but not after "defaultTimeScaleIndependent"
    11.  
    12.         DOTween.defaultTimeScaleIndependent = true;
    13.  
    14.         image.DOLocalMoveY(-450,5);
    15.  
    16.     }
    And now everything is OK, the animation lasts for 5 seconds.
    It seems weird that we have to call "DOTween.Init();" manually to fix that.
     
  45. D3ntrax

    D3ntrax

    Joined:
    Mar 21, 2014
    Posts:
    35
    @Izitmee

    Thank you, You're Awesome !
     
  46. D3ntrax

    D3ntrax

    Joined:
    Mar 21, 2014
    Posts:
    35
    @Izitmee

    Hello Again,

    I'm working on a Tile-Based game and I can't figure out how to make my tiles bounce effect smoothly like in candy crush.
    I am using IEnumerator and DOTween. I have some troll problems. :D How can i fix this code ?

    My Code :


    Code (CSharp):
    1. public IEnumerator ApplyTileBounceEffect(float bounceStiffness, float bouncePower, float firstBounceBackFactor = 0.4f) {
    2.   if (!this.fallBounceAnimEnabled) {
    3.   this.fallBounceAnimEnabled = true;
    4.   if (NormalTile.OnStartTileImpactBounce != null) {
    5.   NormalTile.OnStartTileImpactBounce.Invoke(this);
    6.   }
    7.   this.fallBounceAnimTweener1 = transform.DOLocalMove(Vector3.up * bouncePower, bounceStiffness).SetEase(Ease.OutExpo);
    8.   if (NormalTile.fallBounceWait == null) NormalTile.fallBounceWait = new WaitForSeconds(bounceStiffness * firstBounceBackFactor);
    9.   yield return NormalTile.fallBounceWait;
    10.   this.fallBounceAnimTweener2 = transform.DOLocalMove(transform.localPosition, bounceStiffness).SetEase(Ease.OutBounce).OnComplete(delegate {
    11.   this.fallBounceAnimEnabled = false;
    12.   });
    13.   }
    14.   yield break;
    15.   }
    It's look like very very troll. Here ;

     
  47. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    @Furkann
    maybe try this?
    Code (CSharp):
    1. public IEnumerator ApplyTileBounceEffect(float bounceStiffness, float bouncePower, float firstBounceBackFactor = 0.4f) {
    2.   if (!this.fallBounceAnimEnabled) {
    3.   this.fallBounceAnimEnabled = true;
    4.   if (NormalTile.OnStartTileImpactBounce != null) {
    5.   NormalTile.OnStartTileImpactBounce.Invoke(this);
    6.   }
    7.   this.fallBounceAnimTweener1 = transform.DOLocalMove(Vector3.up * bouncePower + [B]transform.position[/B], bounceStiffness).SetEase(Ease.OutExpo);
    8.   if (NormalTile.fallBounceWait == null) NormalTile.fallBounceWait = new WaitForSeconds(bounceStiffness * firstBounceBackFactor);
    9.   yield return NormalTile.fallBounceWait;
    10.   this.fallBounceAnimTweener2 = transform.DOLocalMove(transform.localPosition, bounceStiffness).SetEase(Ease.OutBounce).OnComplete(delegate {
    11.   this.fallBounceAnimEnabled = false;
    12.   });
    13.   }
    14.   yield break;
    15.   }
    if that doesnt work, try local position, I am not sure if this will do, I didnt test it, but it is worth a try, hope this helps!
     
    Izitmee likes this.
  48. D3ntrax

    D3ntrax

    Joined:
    Mar 21, 2014
    Posts:
    35
    @JakeTBear

    Thank you very much, my second problem, When I destroy the object, I sometimes get this error.


     
  49. sevensails

    sevensails

    Joined:
    Aug 22, 2013
    Posts:
    483
    I have a problem and can't find the reason! After creating tons of Tweens in a short period of time I got errors similar to this one:

    Code (csharp):
    1.  
    2. IndexOutOfRangeException: Array index is out of range.
    3. (wrapper stelemref) object:stelemref (object,intptr,object)
    4. DG.Tweening.Core.TweenManager.AddActiveTween (DG.Tweening.Tween t) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Core/TweenManager.cs:769)
    5. DG.Tweening.Core.TweenManager.GetTweener[Vector3,Vector3,VectorOptions] () (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Core/TweenManager.cs:97)
    6. DG.Tweening.DOTween.ApplyTo[Vector3,Vector3,VectorOptions] (DG.Tweening.Core.DOGetter`1 getter, DG.Tweening.Core.DOSetter`1 setter, Vector3 endValue, Single duration, DG.Tweening.Plugins.Core.ABSTweenPlugin`3 plugin) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/DOTween.cs:944)
    7. DG.Tweening.DOTween.To (DG.Tweening.Core.DOGetter`1 getter, DG.Tweening.Core.DOSetter`1 setter, Vector3 endValue, Single duration) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/DOTween.cs:348)
    8. DG.Tweening.ShortcutExtensions.DOLocalMoveY (UnityEngine.Transform target, Single endValue, Single duration, Boolean snapping) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/ShortcutExtensions.cs:582)
    9. Token.Update () (at Assets/_Game/Scripts/Token.cs:938)
    10.  
    Another one :

    Code (csharp):
    1.  
    2. IndexOutOfRangeException: Array index is out of range.
    3. DG.Tweening.Core.TweenManager.FilteredOperation (OperationType operationType, FilterType filterType, System.Object id, Boolean optionalBool, Single optionalFloat, System.Object optionalObj, System.Object[] optionalArray) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Core/TweenManager.cs:413)
    4. DG.Tweening.DOTween.IsTweening (System.Object targetOrId) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/DOTween.cs:870)
    5. Token.Update () (at Assets/_Game/Scripts/Token.cs:972)
    6.  

    After I got these erros, DOTWEEN breaks and I have to restart.

    Any suggestion?
     
  50. Tastman

    Tastman

    Joined:
    Mar 12, 2015
    Posts:
    7
    Why does the linear easing in a sequence behave differently from a tweener?

    I was about to pull my hair out over not being able to make a looping sequence tween in a linear motion, when I realized I could create separate tweeners with no issues.
     
unityunity