Search Unity

DOTween (HOTween v2), a Unity tween engine

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

  1. Dan2013

    Dan2013

    Joined:
    May 24, 2013
    Posts:
    200
    Understood. I tried those control methods.
    As long as a tween is not killed automatically or manually, it can be controlled by those control methods.
     
  2. wxxhrt

    wxxhrt

    Joined:
    Mar 18, 2014
    Posts:
    163
    The code below plays both of the transform.DOMoves at the same time. Any idea how I can get them to play one after another.
    Code (JavaScript):
    1. import DG.Tweening;
    2.  
    3. var triggerKey : String;
    4.  
    5. enum MoveMode{Absolute,Relative};
    6. var thisMoveMode : MoveMode;
    7.  
    8. var waypointArray : WaypointCustom[];// = new WaypointCustom[];
    9.  
    10. private var mySequence : Sequence;
    11. private var initialPos : Vector3;
    12.  
    13. function Start ()
    14. {  
    15.     initialPos = this.transform.position;
    16. }
    17.  
    18. function Update ()
    19. {
    20.     if (Input.GetKeyDown(triggerKey))
    21.     {  
    22.        
    23.         //stop previous sequence and reset position to zero
    24.         mySequence.Kill(true);
    25.         mySequence.Append(transform.DOMove(initialPos, 0, false));
    26.        
    27.         // for each entry in WaypointCustom
    28.         for (var n : int = 0; n < waypointArray.Length; n++)
    29.         {  
    30.             // add move to, over time, then hold at that position
    31.             mySequence.Append(transform.DOMove(waypointArray[n].moveTo, waypointArray[n].moveToTime, false));
    32.             mySequence.AppendInterval(waypointArray[n].holdTime);
    33.             Debug.Log(n);
    34.         }
    35.        
    36.         mySequence.PlayForward();
    37.     }
    38. }
    39.  
    40.  
    41. class WaypointCustom
    42. {
    43.     var moveTo : Vector3;
    44.     var moveToTime : float;
    45.     var holdTime : float;
    46. }
     
  3. Dan2013

    Dan2013

    Joined:
    May 24, 2013
    Posts:
    200
    @Izitmee
    Is it possible to trigger an action when a moving object reaches a waypoint of a catmull curve?
    This triggered action can be an callback or joined tween (e.g. when waypoint[2] is reached, start a rotation tween).
     
  4. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    Demigiant likes this.
  5. Dan2013

    Dan2013

    Joined:
    May 24, 2013
    Posts:
    200
    @JakeTBear @Izitmee
    Oh, I had a look at that function before, and I omitted it based on its name, since I thought it was a trigger that is called when value of a waypoint is changed... Thanks, Jake.

    Now the other remaining question is:
    What is the easy way to "join" a tween (e.g. rotation tween) to a waypoint on a catmull curve path?
    I think I can do that with OnWaypointChange(TweenCallback) and some Composited GameObject. I may try this and post my result back later.


     
  6. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    @Dan2013 You could also pause the path, trigger another tween and on its on complete resume the path, unless I misunderstood what you wanted to do, still, with DOTween there is a lot that can be done in many ways :) have fun experimenting!
     
    Demigiant likes this.
  7. Dan2013

    Dan2013

    Joined:
    May 24, 2013
    Posts:
    200
    I try to rotate a object while it is moving on a catmull curve path.
    Ideally, I want to trigger the rotating tween when the object reaches a waypoint of the catmull curve path.

    See the code below.
    Attach it to a GameObject to run.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. using DG.Tweening;
    5.  
    6. public class OnWayPointAction : MonoBehaviour
    7. {
    8.     public Vector3[] WayPoints;
    9.     public float Duration;
    10.    
    11.     //public Transform Child;
    12.     //if need to rotate Child of the Object with curve path, do:
    13.     //1) uncomment this line above.
    14.     //2) use Child.DOLocalRotate() to replace transform.DOLocalRotate() in OnReachWayPoint().
    15.     //3) create a child object, and attach it to Child.
    16.    
    17.     void Start()
    18.     {
    19.         WayPoints = new Vector3[4];
    20.         WayPoints[0] = new Vector3(0,0,0);
    21.         WayPoints[1] = new Vector3(0,0,8);
    22.         WayPoints[2] = new Vector3(8,0,8);
    23.         WayPoints[3] = new Vector3(8,0,0);
    24.        
    25.         Duration = 8.0f;
    26.        
    27.         StartPath();
    28.     }
    29.    
    30.     void StartPath()
    31.     {
    32.         transform.DOLocalPath(WayPoints, Duration, PathType.CatmullRom, PathMode.Full3D, 10, Color.white)
    33.             .SetEase(Ease.Linear)
    34.             .OnWaypointChange(OnReachWayPoint);
    35.     }
    36.    
    37.     void OnReachWayPoint(int i){
    38.         Debug.Log("current WayPoint " + i);
    39.        
    40.         if (i == 2)
    41.         {
    42.             transform.DOLocalRotate(new Vector3(0, 90, 0), 1.0f);
    43.             //Child.DOLocalRotate(new Vector3(0, 90, 0), 2.0f);
    44.         }
    45.        
    46.         if (i == 3)
    47.         {                      
    48.             transform.DOLocalRotate(new Vector3(0, 0, 90), 1.0f);
    49.             //Child.DOLocalRotate(new Vector3(0, 0, 90), 1.0f);
    50.         }
    51.     }
    52. }
     
  8. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    @Dan2013 That should work, what are you getting? I have used the composite gameobject way you mentioned with great success, so you would basically translate the parent and rotate a child, it works.

    But I still think that your code should work.
     
    Demigiant likes this.
  9. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @dl_studios Hey! I finally did it! Had to work on it a lot to find the correct way to implement it, and decided to create an internal custom plugin. Wanna give it a try (see the attached version) and let me know? Now there are two additional transform shortctus: DORotateQuaternion and DOLocalRotateQuaternion.

    @JakeTBear Thanks a lot for the support! :)

    EDIT: Woops, didn't notice there was another page of comments, answering in a few minutes!
     

    Attached Files:

    Last edited: Oct 15, 2015
  10. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @Paulo Henrique Paulo! Long time no see! Glad you like DOTween! And no, you don't need the pro to use paths. Just use the DOPath transform shortcuts that are ready-made for that. Also, there's a few examples here.

    @wxxhrt Append definitely starts one tween after the previous one has finished, I'm sure that has no bugs. I see something else wrong in your code though. If you want to kill and recreate a Sequence, you not only have to call mySequence.Kill, but also DOTween.Sequence();
    Code (csharp):
    1. mySequence.Kill();
    2. mySequence = DOTween.Sequence();
     
  11. Dan2013

    Dan2013

    Joined:
    May 24, 2013
    Posts:
    200
    Yea, it works.
     
  12. AllanMSmith

    AllanMSmith

    Joined:
    Oct 2, 2012
    Posts:
    180
    Hey,

    I've looked around but couldn't find anyone with this issue so maybe I am doing something wrong. My game uses NGUI for practically everything UI-wise, and I was until recently using HOTween to animate my buttons colors and multiple properties really. It was working nicely but I decided to upgrade to DOTween as its better, accordingly to you =P.

    However, apparently it is not being able to tween the color of NGUI Widgets for some reason. Here is the call I am using:
    Code (CSharp):
    1. _tweenColor = DOTween.To(() => _childWidgets.color, x => _childWidgets.color = x, _pressedColor , _currentAnimationDuration).SetAs(_tweenParams);
    And the _tweenParams in this occasion:
    Code (CSharp):
    1. _tweenParams.SetEase (Ease.InOutSine).SetUpdate(true);
    In short, its just not working =/ Meanwhile, this other call is working as expected:
    Code (CSharp):
    1. _tweenHighlight = DOTween.To(() => HighlightSprite.alpha, x => HighlightSprite.alpha = x, 1f, _currentAnimationDuration).SetAs(_tweenParams);
    So... any idea on what might be causing this issue? The color doesn't get tweened at all, not even changed =/.

    PS: I already checked, the code is being called.
    PS2: I posted the same question in DOTween forums but not sure where you check =P

    Thanks in advance,
    Allan
     
  13. wxxhrt

    wxxhrt

    Joined:
    Mar 18, 2014
    Posts:
    163
    @Izitmee

    Thanks, thats got it all working!
     
  14. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @wxxhrt Great! :)

    @AllanMSmith I answered on those other forums (though I would've answered here if I saw this before the others), but if anyone has some suggestion please chime in.
     
  15. dl_studios

    dl_studios

    Joined:
    Oct 14, 2012
    Posts:
    76
    @Izitmee Awesome! Thank you so much for creating a quaternion rotation tweener! You're support has been awesome. We just purchased dotween pro seats to throw some monetary shout-outs your way--and to get the awesome pro features as well. :)

    While testing, however, we have come across an issue. It appears that the rotation only goes half way to the target value and then stops.

    I've attached a project that demonstrates the issue. In the scene we ask the animatedCube to match four consecutive target rotations, 90, 180, 270, and 360. The animation ends up instead going to 45, 90, 135, and 180.

    Thank you for taking the time to make this extension.
     

    Attached Files:

  16. jack021457

    jack021457

    Joined:
    Mar 18, 2015
    Posts:
    22
    Hi, I have some little problem,hope you help me. when 2 path Intersect,and there are some Object move on them, Sometimes there will be some inexplicable points. They seem to be self-generated. It looks like the connection from one point on the path to another path. This is not what I want, I want my game objects run on their own path. And not on a path that should not exist runs. What is the reason for this situation may be?How can I fix it. I use poolboss a pooling system,I found the gameobject was not despawned is look normal, when the gameobject despawned, was happen wrong. thanks
     
    Last edited: Oct 16, 2015
  17. SidarVasco

    SidarVasco

    Joined:
    Feb 9, 2015
    Posts:
    163
    Q: Is it possible to reverse the easing on looped tweens?
    The effect I basically want is a continues curve.
     
  18. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    @jack021457 could you share the code where you create the path? the gameobject that is being pooled.
     
  19. jack021457

    jack021457

    Joined:
    Mar 18, 2015
    Posts:
    22
    I create a empty gameobject and add Do Tween Path Component, and create the waypoints in this gameObject. In code, I use gameObject.GetComponent<DOTweenPath>().wps.ToArray() to get the Vector3[] type variable. When the pooling system spawned one gameobject, then calling gameobject.DOPath() function to move.
     
  20. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @dl_studios Ouch, sorry for that, definitely a bug. I was calculating the Quaternion change value in what should've been the correct way but apparently not. Attached is an update which fixes that, let me know if everything's alright now (in my tests now it is). And thanks a big lot for getting the Pro! :)

    @SidarVasco You can use SetEase to change the ease of a tween whenever you want. But to make things even easier, you could simply use an InOut ease of any kind, which will smoothly flow in and out of loops as if it was all the same movement.

    @jack021457 I can assure you that there are no "intersection" waypoints added (that would be a pretty complicated feature to add, and I didn't do it). But if you're using the path with a pooling system, you should add a manager to your gameObject (use the "Add Manager" button that appears on top of the DOPath inspector) and set the preset to "Pooling System", so that the path is recreated correctly from your spawn point.

    dotween_manager.png
     

    Attached Files:

  21. jack021457

    jack021457

    Joined:
    Mar 18, 2015
    Posts:
    22
    @lzitmee
    Can I add DOTweenVisualManager by code? My DOTweenPath is just a empty gameobject, I only use it's waypoint. I use transform.DOPath() to move gameobject. so how can I add visual manager by code, or I add the visual manager to have DOTweenPath gameobject. thanks a lot
     
  22. jack021457

    jack021457

    Joined:
    Mar 18, 2015
    Posts:
    22
    HI, I trying to call transform.DORestart(false) after the gameobject spawned. It's worked. but I don't know is that right?
     
  23. SidarVasco

    SidarVasco

    Joined:
    Feb 9, 2015
    Posts:
    163

    Tried that, results were not exactly what I was looking for but ill try some different easings. Thanks for the reply
     
  24. dl_studios

    dl_studios

    Joined:
    Oct 14, 2012
    Posts:
    76
    @Izitmee Awesome! Thank you so much for the fix! The plugin works wonderfully.

    One little thing we'd like to know how to turn off the Debug for the DoQuaternionRotate tweener. We tried calling DOTween.Init(null,null, LogBehaviour.ErrorsOnly); before any tweeners ran, however it didn't seem to affect the debug at all. Is there another way to turn it off?

    Thanks again!
     
  25. jack021457

    jack021457

    Joined:
    Mar 18, 2015
    Posts:
    22
    Hi, guys. I want to make a effect like picture down below. Is a airplane move with a path, when the airplane turn, the airplane roll some angle. Is there have good way to do, or have corresponding API? thanks a lot
     

    Attached Files:

    • 222.png
      222.png
      File size:
      27.6 KB
      Views:
      930
    • 111.png
      111.png
      File size:
      23.3 KB
      Views:
      920
  26. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    @jack021457 In this very page, another user was trying to achieve something very similar.

    You can add callbacks to your waypoints (docs), so when you get to a waypoint you can pause the path tween and activate the desired movement, once that finishes, restart the path tween.

    There are a couple of other ways to do this, but I think this method would fit your needs better.

    If you need any more specific details on how to achieve that I highly recommend the very complete docs, but if you still stuck let us know.
     
  27. jack021457

    jack021457

    Joined:
    Mar 18, 2015
    Posts:
    22
    Your answer to me is very helpful, I'll try. thank you very much.:)
     
  28. Mr_Cad

    Mr_Cad

    Joined:
    Dec 7, 2013
    Posts:
    27
    I'm trying to do the following codes:
    sprite is a tk2dSprite class from 2D Toolkit.
    sprite.scale is a member instance of sprite with datatype of vector3
    Code (CSharp):
    1. DOTween.To(()=> sprite.scale, x=> sprite.scale = x, scale, 0.08f).SetLoops(2, LoopType.Yoyo);
    I want to know whether this sprite is Tweening or not, by calling this it doesn't work
    Code (CSharp):
    1. if (DOTween.IsTweening(sprite)) {}
    I also tried this, doesn't work either:
    Code (CSharp):
    1. if (DOTween.IsTweening(sprite.scale)) {}
    Any other way I can know whether it's tweening? I'm avoiding to do something like this:
    Code (CSharp):
    1. Tweener tweener = DOTween.To(()=> sprite.scale, x=> sprite.scale = x, scale, 0.08f).SetLoops(2, LoopType.Yoyo);
    Because I don't want to store the Tweener locally.
     
  29. jack021457

    jack021457

    Joined:
    Mar 18, 2015
    Posts:
    22
    Hi, JakeTBear. How to get the length between two points, I want to use length/speed=time. thanks a lot :)
     
  30. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    @jack021457 If you were to store the path in a local variable you could refer to it for distances.

    Code (CSharp):
    1.         Vector3[] PathPoints = new Vector3[5];
    2.         PathPoints[0] = new Vector3(0.0f, 0.0f, 0.0f);
    3.         PathPoints[1] = new Vector3(2.0f, 0.0f, 0.0f);
    4.         PathPoints[2] = new Vector3(2.0f, 4.0f, 0.0f);
    5.         PathPoints[3] = new Vector3(-2.0f, 0.0f, 0.0f);
    6.         PathPoints[4] = new Vector3(0.0f, 0.0f, 0.0f);
    7.         Tweener T = transform.DOPath(PathPoints, 3.0f, PathType.Linear, PathMode.Sidescroller2D).OnWaypointChange((x) =>
    8.         {
    9.             float Distance = 0.0f;
    10.             //x is the pathpoint index
    11.             if(x < PathPoints.Length-1)
    12.             {
    13.                 Distance = Vector3.Distance(PathPoints[x], PathPoints[x + 1]);
    14.             }
    15.             //Do something with the distance
    16.  
    17.         });
    Hope this helps!
     
  31. jack021457

    jack021457

    Joined:
    Mar 18, 2015
    Posts:
    22
    Hi @JakeTBear , thanks for your help. I will try it. thanks again
     
  32. AwDogsGo2Heaven

    AwDogsGo2Heaven

    Joined:
    Jan 17, 2014
    Posts:
    102
    I would like to make a Sprite flicker randomly for a period of time. Is it possible to do this with DOTween? I thought about creating a sequence of Fades , but I don't know how to put a delay between two appends (I guess SetDelay sets the same delay between every append, but what if I want different delays?
     
  33. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    @AwDogsGo2Heaven I believe it is very possible, I wouldnt use a sequence for this because it would be harder to tweak for your needs.

    I didnt test this code but I think it will take you in the right direction:
    Code (CSharp):
    1. tk2dSprite Sprite;
    2.     void Flicker(int count)
    3.     {
    4.         if (count > 0)
    5.         {
    6.             Sprite.DOFade(0.0f, 0.0f).OnComplete(() =>
    7.             {
    8.                 Sprite.DOFade(1.0f, 0.0f).SetDelay(0.1f).OnComplete(() =>
    9.                 {
    10.                     count--;
    11.                     Flicker(count);
    12.                 });
    13.             });
    14.         }
    15.     }
    Hope this helps!
     
  34. AwDogsGo2Heaven

    AwDogsGo2Heaven

    Joined:
    Jan 17, 2014
    Posts:
    102
    This put me on the right track, thanks JakeTBear!
     
  35. mambo_2

    mambo_2

    Joined:
    Aug 19, 2013
    Posts:
    19
    Hello,

    Izitmee Thank you for all your hardwork, I have a question that I would love to know the answer to, I am currently working on extending your plugin with a visual sequence manager, but I noticed that Tweens that have their isBackward flag set to true and then appended to the final Sequence actually play forward, so I was wondering if the original tween settings get overridden once they are added to a Sequence, it would be really helpful if they did not though.

    I attached a small preview of how the manager looks like, basically it registers the DotweenAnimations and has the insertion types to a sequence as a popup, my problem is with the Play Backward toggle, it works correctly but as stated above the problem is internal within how Sequences are played.

    Thank you.
     

    Attached Files:

    Last edited: Oct 25, 2015
  36. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Hi, I am using dotween for jump player,jetpack power up.

    I am also using animator's animation system to rotate character simultaneously.But the thing is animator's rotation is not occurring nor dotween is working with each other.

    When I disable animator from gameobject then dotween do work properly and vice varsa.

    My gameobject setup is,
    Parent - (moving with @Baroni 's simple waypoint system's splineMove)
    Child - (contains actual character who jumps and rotates)
     
  37. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    If an attribute is controlled by the animator, then you can't control via script. (at least not a way that isn't problematic.

    Look at it this way, if you have two things telling an object to rotate, only one will actually happen. What you need to do if you are tweening (or controlling an object's transform via script), is to nest them so that one is controlled by the animator and one by script. Though it can get a little convoluted unless you do it carefully.

    The best idea is to do one or the other, but not both.
     
  38. sdviosx

    sdviosx

    Joined:
    Jan 4, 2015
    Posts:
    22
    Is there a way to update the delay value on runtime? I am using the method ChangeEndValue so I can change the shooting direction and duration of a turret on runtime, but I cant figure out how to update the delay value.

    Or what is the best general approach for updating values on a tween on runtime.

    Code (CSharp):
    1. moveTween = projectile.transform.DOLocalMove(fireDirection, duration)
    2.                 .SetAutoKill(false)
    3.                 .SetEase(Ease.Linear)
    4.                 .SetDelay(delay)
    5.                 .OnComplete(FireProjectile);
    Code (CSharp):
    1. public void FireProjectile ()
    2.     {
    3.         if (moveTween.IsPlaying())
    4.             return;
    5.  
    6.         // Update Delay value?
    7.         moveTween.ChangeEndValue(fireDirection, duration);
    8.  
    9.         moveTween.Restart(true);
    10.     }
     
    Last edited: Oct 27, 2015
  39. songofhawk

    songofhawk

    Joined:
    Dec 14, 2014
    Posts:
    10
    When i using path in HOTween, the GameObject can auto-rotate which decided by direction to move. In DOTween, if i call DOPath on a GameObject, it will move node by node, but never rotate. Is there any option to make auto rotation? by this feature, i can ensure the face of my role is always forward.
     
  40. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    @songofhawk I tried with a cube and it seems that when you create and use a path in code it doesnt really follow its orientation by default, in the pro version, if you create a path from the editor, it follows this behaviour with no problems.

    So there might be something odd going on with the code of DoPath (I tested some things with the SetLookAt function)

    Regardless, if you know the path or you can get a hold of it you can still achieve the same effect, here is an example:

    Code (CSharp):
    1. public class PathWithLookAt : MonoBehaviour
    2. {
    3.     public Vector3[] AllPoints;
    4.  
    5.     void OnEnable()
    6.     {
    7.         Tweener Pather = transform.DOPath(AllPoints, 5.0f, PathType.CatmullRom);
    8.         Pather.OnWaypointChange((x) =>
    9.         {
    10.             transform.LookAt(AllPoints[x + 1]);
    11.         });
    12.     }
    13. }
    Hope this helps.
     
  41. songofhawk

    songofhawk

    Joined:
    Dec 14, 2014
    Posts:
    10
    Thanks @JakeTBear, it's a great idea! Moreover, it resolved another problem: in some special case, i don't want auto-rotate feature,but in general, i want. This solution is perfect.
     
    Last edited: Oct 27, 2015
  42. songofhawk

    songofhawk

    Joined:
    Dec 14, 2014
    Posts:
    10
    BTW, we should use "x", not "x+1" as AllPoints index, in OnWaypointChange event.
     
  43. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Yes you have a point, yet I am using dotween to just jump and animator for rotation...
     
  44. auraPasat

    auraPasat

    Joined:
    Jul 30, 2015
    Posts:
    2
    Hi, I'm having some trouble with DOTween animations attached to a game object.

    So, on a game object with a text component I got next animations :
    - Color animation to red , delay 0, duration 1
    - Scale to 1.5, delay 0, duration 1
    - Color to white, delay 2, duration 1
    - Scale to 1, delay 2, duration 1

    Animations don't have turned on AutoPlay or AutoKill, they are started from script with DOTween.Restart. They all have the same Id and I start all of them at the same time.

    The problem is that the last 2 animations don't work properly, after the delay for them elapsed and they should start, it seams that before they start, the object (the text component) returns to the default state (which is what the last 2 animations should do, but, you know...animating) and so the animations are not "seen".
    I found this after I changed the last 2 animations to do something else, not turning the text to the default state.

    Can someone please tell me if there's a known issue or I should do something else?

    If the AutoPlay is turned on, everything works, except that the animations are also played when the object is instantiated (not what I want).

    I already tried changing the Ids, delays etc, nothing worked and the issue can be easily reproduced with a fade in animation and a fade out one after delay.

    Thank you.
     
  45. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    When I attempted to use x only I noticed that the rotation was following the element behind it. the last waypoint didnt get a callback as well, I made a very complicated curve and the correct result was by using the index +1. Did you get something different?
     
  46. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    I am assuming things here.
    I believe that when you do a restart in code, the tween will lock in their initial value and go from there, delays don't magically tell a tween where do they start from.

    I just checked and it seems that the Color property doesnt have a "relative" option in the inspector, but Scale does, this should make it go from where the tween is at towards the desired value, you will have to wait for an official answer from @Izitmee or someone else who knows better for the color portion, but give it a go! best of luck and hope this helped!
     
  47. auraPasat

    auraPasat

    Joined:
    Jul 30, 2015
    Posts:
    2
    @JakeTBear thanks for your answer, but the "relative" option will generate this behaviour :

    The object scales to 1.5, then, before the scale to 1 starts, the object will return to initial state (of scale 1.0), but the scale to 1 animation will consider that the 1.5 scale is the initial state.
    So it will perform an animation of scale to 1.5..

    For now, I'm starting the last 2 animations (without delay) when the first 2 are finished, but it's not the right way because this means that you will have to know from script how long the delay should be.

    Thank you, anyway.
     
  48. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    Bummer :(
    I am sure Daniele will be able to help you better, if you could for now build your animation in code, it will work no problems.
    Instead of delays you could use OnComplete function calls to do the next step, it is very handy :)

    Best of luck!
     
  49. pea

    pea

    Joined:
    Oct 29, 2013
    Posts:
    98
    Hi @Izitmee! Hey, I'm experiencing a lot of these - yes it's my fault heh heh - and I'm wondering if it's possible to have DOTween output the exact callback/object that is experiencing problems. It's almost impossible to debug as I have hundreds of tweens/sequences with callbacks...

    Code (CSharp):
    1. DOTWEEN :: An error inside a tween callback was silently taken care of
     
  50. pea

    pea

    Joined:
    Oct 29, 2013
    Posts:
    98
    Ah, I should have upgraded to the latest version first! The log entries now have more information. Thank you!!

    Code (CSharp):
    1. DOTWEEN :: An error inside a tween callback was silently taken care of > The object of type 'Transform' has been destroyed but you are still trying to access it.
    2. Your script should either check if it is null or you should not destroy the object.
    3.  
    4.   at (wrapper managed-to-native) UnityEngine.Transform:INTERNAL_get_position (UnityEngine.Vector3&)
    5.   at UnityEngine.Transform.get_position () [0x00000] in <filename unknown>:0
    6.   at behaviourLaser.Shoot () [0x0002a] in BLAHBLAHBLAH...
    7.