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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

DOTween (HOTween v2), a Unity tween engine

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

  1. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    672
    Also, have you tried using Restart() instead?
     
  2. DavidRodMad

    DavidRodMad

    Joined:
    Jan 26, 2015
    Posts:
    10
    It's not that it's not being fired, it's that the code literally tells me that it's incorrect when keeping everything the same and just adding "Forward" to the method. Removing the OnComplete it goes back to working correctly.

    upload_2023-1-26_19-22-3.png
    upload_2023-1-26_19-22-30.png
    upload_2023-1-26_19-22-45.png


    Also doesn't like the "oncomplete" on the code.
     
    Last edited: Jan 26, 2023
  3. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    672
    Try reversing the statements

    Code (CSharp):
    1. .OnComplete(() => { your code }).PlayForward();
     
  4. luniac

    luniac

    Joined:
    Jan 12, 2011
    Posts:
    585
    Hi, i'm tweening a Kinematic Rigidbody2D with DoPath on a 2D path.

    I read in unity documentation: "Kinematic Rigidbody 2D is designed to be repositioned explicitly via Rigidbody2D.MovePosition or Rigidbody2D.MoveRotation."

    How do i make sure the DoPath tween is tweening it using Rigidbody2D.MovePosition internally?

    Thanks.
     
  5. DavidRodMad

    DavidRodMad

    Joined:
    Jan 26, 2015
    Posts:
    10
    That worked! Thank you, I didn't know the order mattered
     
    flashframe likes this.
  6. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    672
    Most of the methods in DOTween return the Tween so you can chain them, but for some reason PlayForwards and PlayBackwards don't. Not sure why
     
  7. vitamingames

    vitamingames

    Joined:
    Sep 4, 2013
    Posts:
    2
    I'm running into some truly bizarre behavior and was wondering if one of yall could offer some help.

    Basically, I want to use a Sequence to spawn things at certain times. So, insert a callback to spawn something at, 2 seconds, then another at 5 seconds, and so on. This works great if played like normal, but in my case, I also need to be able to set the time with the built-in. Goto function. However, the frame I begin to do that on the callbacks no longer get called after. Any ideas?

    This is a simple example that you can use to replicate the problem I'm running into.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using System;
    5. using DG.Tweening;
    6.  
    7. public class CallbackSequenceTest : MonoBehaviour
    8. {
    9.     [System.Serializable]
    10.     public class MessageObj {
    11.         public float Time;
    12.         public string Message;
    13.     }
    14.     public List<MessageObj> Messages = new List<MessageObj>();
    15.     Sequence seq;
    16.     float startTime = 0;
    17.  
    18.     // Start is called before the first frame update
    19.     void Start()
    20.     {
    21.         seq = DOTween.Sequence();
    22.         foreach (MessageObj message in Messages)
    23.             seq.InsertCallback(message.Time, () =>
    24.             {
    25.                 Debug.Log(message.Message);
    26.             });
    27.         startTime = Time.time;
    28.         Debug.Log(seq.Duration());
    29.         seq.Play();
    30.     }
    31.  
    32.     void Update() {
    33.         float currentTime = Time.time - startTime;
    34.         seq.Goto(currentTime);
    35.     }
    36. }
    Thanks again for any help yall can offer! Maybe I'm just being dumb who knows.

    EDIT: So I think the issue is that the time range required for the callback is a specific size cause I realized after changing it to FixedUpdate it now works???
     
    Last edited: Feb 5, 2023
  8. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    672
    If you want the Sequence to continue playing after the Goto command, you have to add an extra parameter:

    Code (CSharp):
    1. seq.Goto(currentTime, true);
     
  9. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    251
    Is it possible to combine tweens? I wanna scale and rotate an object simulatenusly
     
  10. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    456
    Guys, I need an advice - how to smoothly start the object rotation (using ease.inSine) and after rotate it by linear speed for ever until decide to stop?

    The standard methods doesn't work here. So, there are 2 ways I know it could work but it doesn't
    1. create 2 tweens: 1st tween for rotation start, 2nd tween for infinite loop linear rotation set on 1st tween.OnComplete callback
    2. create a sequence, same approach as #1 but without OnComplete callback usage

    It doesn't work as expected because 1st part final speed will not ever fit to linear speed if only you will not manually find some reasonable time for 1 circle (360 degrees) rotation. And you will need to do it again just after easing change or any other tween changes.
    I also tried to use SetSpeedBased, but 1st part non linear easing doesn't work well there - as a result 1st part rotates much faster comparing to 2nd part.

    That's code sample

    Code (CSharp):
    1. this.transform
    2.                 .DORotate(new Vector3(0f, -360f, 0f), 520, RotateMode.WorldAxisAdd)
    3.                 .SetEase(Ease.InSine)
    4.                 .SetSpeedBased(true)
    5.                 .OnComplete(() =>
    6.                 {
    7.                     // start infinite loop
    8.                     this.transform
    9.                         .DORotate(new Vector3(0f, -360f, 0f), 520, RotateMode.WorldAxisAdd)
    10.                         .SetLoops(-1, LoopType.Restart)
    11.                         .SetSpeedBased(true)
    12.                         .SetEase(Ease.Linear);
    13.                 });
     
  11. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    672
    That's what a Sequence is for :)

    It's a hack, but my solution would be to use a custom AnimationCurve as the ease for the first tween. I just tried it in the editor and by tweaking the curve's second key to a value of 0.8, the transition seemed pretty smooth.

    Code (CSharp):
    1. public float speed = 520f;
    2.     public AnimationCurve ease;
    3.  
    4.     void Start()
    5.     {
    6.         transform
    7.                 .DORotate(new Vector3(0f, -360f, 0f), speed, RotateMode.WorldAxisAdd)
    8.                 .SetEase(ease)
    9.                 .SetSpeedBased(true)
    10.                 .OnComplete(() =>
    11.                 {
    12.                     // start infinite loop
    13.                     transform
    14.                         .DORotate(new Vector3(0f, -360f, 0f), speed, RotateMode.WorldAxisAdd)
    15.                         .SetLoops(-1, LoopType.Restart)
    16.                         .SetSpeedBased(true)
    17.                         .SetEase(Ease.Linear)
    18.                         .Play();
    19.                 }).Play();
    20.     }

    (I have AutoPlay set to false, which is why my code has Play() calls)

    upload_2023-2-12_11-37-3.png
     
    Liminal-Ridges likes this.
  12. Nefisto

    Nefisto

    Joined:
    Sep 17, 2014
    Posts:
    305
    How I set the loop to dont reset their position to cached start position, instead keep the position set by step complete or something else? I mean, in my mind the folowing code should make the rect transform to go in -135f direction, then reset to new position set in step complete and then going again to position -135, but it reset to original position set when the DoMoveX started

    Code (CSharp):
    1. rectTransform
    2.     .DOMoveX(-135f, durationInScreen, true)
    3.     .OnStepComplete(() => rectTransform.anchoredPosition = new Vector2(135f, Random.Range(0f, 35f)))
    4.     .SetLoops(-1)
    5.     .SetEase(Ease.Linear);
     
  13. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    672
    You may be able to do this if you call ChangeStartValue() in OnStepComplete()
     
  14. Nefisto

    Nefisto

    Joined:
    Sep 17, 2014
    Posts:
    305
    thanks for the answer, a doubt, for being able to call this API I will need to cache the reference to the tween right?
     
  15. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    672
    Yes I believe so
     
    Nefisto likes this.
  16. Nefisto

    Nefisto

    Joined:
    Sep 17, 2014
    Posts:
    305
    Another question, if I have something like

    Code (CSharp):
    1.  
    2. rectTransform
    3.     .DOMoveX(-135f, durationInScreen, true)
    4.     .OnStepComplete(() => b.ChangeStartValue(new Vector3(135f, Random.Range(0f, 34f))))
    5.     .SetLoops(-1)
    6.     .SetEase(Ease.Linear);
    is possible to change durationInScreen at runtime? or as this is created at Start I can't change their values during after creation?
     
  17. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    672
    You use the same ChangeStartValue method - the second parameter is Duration if larger than 0

     
    Nefisto likes this.
  18. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    672
    Although In this case you might want to use ChangeEndValue:

     
  19. thefallengamesstudio

    thefallengamesstudio

    Joined:
    Mar 7, 2016
    Posts:
    724
    Getting some error when importing DOTween pro:
    Code (CSharp):
    1. The type or namespace name 'Core' does not exist in the namespace 'DG.Tweening' (are you missing an assembly reference?)
    2. error CS0234: Assets\Plugins\Demigiant\DOTween\Modules\DOTweenModuleAudio.cs(6,19)
     
  20. mrwellmann

    mrwellmann

    Joined:
    Nov 27, 2015
    Posts:
    27
    When doing
    Code (CSharp):
    1. DOTween.To(DOGetter<float> getter, DOSetter<float> setter, float endValue, float duration)
    or any other Shortcut calling DOTween.To, should I do a safeguard before the call if I can expect that the endValue is often already reached? Or is this handled already efficiently inside DOTween.To?
     
  21. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    672
    You could test this out by adding OnUpdate and OnComplete callbacks and see if they get fired (I'd assume they would). Alternatively, the source code is available:

    https://github.com/Demigiant/dotween/tree/develop/_DOTween.Assembly/DOTween
     
    mrwellmann likes this.
  22. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    680
    Is it a known issue that DOTween does not always behave as it should in the Unity Editor, as it does in an actual build?
     
  23. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    680
  24. KingRecycle

    KingRecycle

    Joined:
    Jul 20, 2013
    Posts:
    26
    I have a function to tween the XP bar
    Code (CSharp):
    1. void UpdateBar() {
    2.             Debug.LogWarning($"{experienceBar.fillAmount} : {experienceManager.GetNormalizedExperience()}");
    3.             experienceBar.DOFillAmount( experienceManager.GetNormalizedExperience(), 1f );
    4.             levelText.text = experienceManager.CurrentLevel.ToString();
    5.         }
    If I call it manually it works just fine but I have it set to be called with an event Invoke.
    Doing it this way will call the Debug.LogWarning but not the actual DoFillAmount.

    Anyone have any idea why DOTween works fine unless it's a function called via event?
     
  25. iLoveGamesDeveloper

    iLoveGamesDeveloper

    Joined:
    Aug 8, 2019
    Posts:
    12
    Hello!
    I have been trying to do some tweening in my buttons, but I have been struggling with some small issues.

    This is a reduced version of what I'm trying to do:
    • A key is pressed
    • A group of buttons within a CanvasGroup should appear but still be a bit transparent
    • After three seconds that group of buttons disappears
    • If the key is pressed in the middle of the above disappearance, the button should appear again, starting from the alpha left-over from the above point.
    • After three seconds that group of buttons disappears
    This is a snippet for the code:
    Code (CSharp):
    1.     private void TriggerTopCanvasSideFadeAway()
    2.     {
    3.         DOTween.Restart("TopAppear");
    4.         topCanvas.DOFade(0.3f, 0.5f).SetId("TopAppear");
    5.         DOTween.Restart("TopFade", true);
    6.         topCanvas.DOFade(0, 0.5f).SetDelay(3f).SetId("TopFade");
    7.     }
    The issue that I'm having is that sometimes the row flashes, as it the fading starts from alpha 1 (you can see it towards the end of the gif).




    (Full script if needed: https://pastebin.com/ffiYAbZd)
     
    Last edited: Mar 2, 2023
  26. ChickenVegetable

    ChickenVegetable

    Joined:
    May 3, 2020
    Posts:
    75
    Hi
    Is there a way to pause a sequence mid way through, but to ease to a stop rather than halt suddenly?

    Thanks
     
  27. SeerSucker69

    SeerSucker69

    Joined:
    Mar 6, 2021
    Posts:
    49
    Hi guys, quick dumb question that must be simple to do.....

    I want my sprite to take ten steps in a grid, and for each step I want to call a method. "updateUnit"

    Code (CSharp):
    1.         foreach (Location mytile in myPath)  // Step through tiles in path to destination
    2.         {
    3.             utar = IsoMap.I.MyTilesParent.transform.position + IsoMap.I.MapToScreen(mytile.X, mytile.Y);
    4.  
    5.             IsoMap.I.Units[CurrentUnit].MyGO.transform.DOMove(utar, 5.5f).OnComplete(UpdateUnit);
    6.  
    7.             IsoMap.I.Units[CurrentUnit].MyCell = new(mytile.X, mytile.Y);
    8.  
    9.         }
    So instead of what I want, it calls the method ten times after the unit reaches the end of the path, instead of after each DOMove has completed.

    What am I doing wrong? How do I get this loop to set up ten tweens, with ten calls to my method after each one completes?
     
  28. ExNull-Tyelor

    ExNull-Tyelor

    Joined:
    Apr 21, 2022
    Posts:
    14
    Not sure where the best place to post this is, but the custom plugin example is currently a bit broken. In CustomRangePlugin on line #249, the method definition is missing a parameter:
    int newStepsTaken


    This makes the example not build or run until this parameter is added like so:
    Code (CSharp):
    1. public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter<CustomRange> getter, DOSetter<CustomRange> setter, float elapsed, CustomRange startValue, CustomRange changeValue, float duration, bool usingInversePosition, int newStepsTaken, UpdateNotice updateNotice)
     
  29. SeerSucker69

    SeerSucker69

    Joined:
    Mar 6, 2021
    Posts:
    49
    This example code in the documentation gives an error for the onWaypointChange(MyCallback);

    CS1503 Argument 1: cannot convert from "method group" to "int"


    Code (CSharp):
    1. void Start() {
    2.    transform.DOPath(waypoints, 1).OnWaypointChange(MyCallback);
    3. }
    4. void MyCallback(int waypointIndex) {
    5.    Debug.Log("Waypoint index changed to " + waypointIndex);
    6. }
     
  30. iLoveGamesDeveloper

    iLoveGamesDeveloper

    Joined:
    Aug 8, 2019
    Posts:
    12
    Hello, I'm using a tween to modify the weight of a post-processing volume. When I'm increasing the weight, it seems to stop or pause before reaching the target value. I have a second one that decrease it to zero, and it seems to be working fine.

    For the problematic one, I want the weight to go from 0 to 0.9, and it seems to stop around 0.3, sometimes 0.6, but its very random. I don't have many tweens at all, and I do not have functions controlling all tweens. I have the variables in the inspector, and if I try changing the duration to 2 secs instead of 0.1, it ends even faster.

    I added some callbacks for OnComplete, but they are called when the Fade Out (second) tween is called. I'm fairly confused on what's going on.

    What are some tips on how to debug this?

    Edit: I added some Debug.log that is letting me know whenever I press a key if there are tweens active, paused, and such, and after running the first Tween, it seems it just stays Active and Playing without doing anything or completing (while nothing appears as paused).

    Solved: The issue was that when I was opening a menu I was setting the TimeScale to 0 and that was pausing the Tween. I had to make the tween independent of TimeScale.
     
    Last edited: Mar 10, 2023
  31. watchagames

    watchagames

    Joined:
    Oct 1, 2017
    Posts:
    16
    Hi, great plugin love it/used it for years.
    Cleaning some cleaning code (that is removing tweens on objects).
    Is there a way to get the number of tweens running on a transform ?
    Thx
     
  32. Thrazamund

    Thrazamund

    Joined:
    Apr 14, 2017
    Posts:
    31
    Hello, I'm using a DOTweenPath script to run an animation that loops infinitely at some point I want to pause this animation but only after waiting for it to complete it's next step in the animation. How would I do this?
     
  33. billslot

    billslot

    Joined:
    Apr 4, 2022
    Posts:
    1
    I am using DOTweenPath and I am having an issue with were the paths end up being displayed. The game has a prefab that is instantiated and covers the entire screen. On the prefab I have some paths. When the game is run and I display the prefab the paths are not visible. When I go to the scene view to find them they are way off of the screen. I am not using any code at this point. The prefab is instantiated at x=840, y=525 which is center screen but the paths are at negative x=-840, y=-525.
     

    Attached Files:

  34. yadu

    yadu

    Joined:
    Dec 6, 2014
    Posts:
    9
    Not sure if anyone has asked this before (and I couldn't find an answer when I searched for it), OnComplete gets called for each DOBlendable* function, but is there like a cumulative OnBlendableCompelte sort of a function or something similar?
     
  35. squeaker091

    squeaker091

    Joined:
    Mar 20, 2023
    Posts:
    20
    help me I'm doing a tutorial and i am getting the message, "Camera does not contain a definition for DOFieldOfView I do not know what's going on. help
     
  36. Nakor

    Nakor

    Joined:
    Sep 5, 2012
    Posts:
    31
    I'm trying to create a ScriptableObject that on Awake copies the WPS from the DOTweenPath script on one of my scene objects. I can create my asset and copy the WPS, but my problem is that I want to clear it after I copy it. Calling pathScript.wps.Clear() or pathScript.fullWps.Clear() doesn't work. I don't seem to have access to the same functionality as the "Reset Path" button that the DOTweenPath editor script uses. I'm using the Pro version if that matters. If anyone has a solution I would definitely appreciate it.
     
  37. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    Can I run a tween inside an async method?
    I have an async method that displays a text countdown and would like to pulse the text in some kind of interesting way.
    The text is a TextMeshPRO, but I only have the free version of Dotween.
    (See code below.)

    Thanks. -- Paul

    Code (CSharp):
    1.   async void CountdownTimerWithMessage(string argMessage, int argCountdownSeconds) {
    2.         m_MessageText.text = "";
    3.      
    4.         for (int secondsRemaining = argCountdownSeconds; secondsRemaining >= 0; secondsRemaining--) {
    5.             //
    6.             // Use a tween to pulse the message text?
    7.             //
    8.             m_MessageText.text = argMessage + String.Format("{0:0}", secondsRemaining);
    9.             await Task.Delay(1000);
    10.         }
    11.     }
     
  38. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    210
    Hello, first time using DOtween pro here.

    I want to achieve a sequence for "aquiring weapon"
    1- hover the weapon a bit
    2- after 0.8 sec hovering, mixing it with flying to a Hand transform

    What I want is not play a animation, then next animation. That will feel rigid.
    I want some mixing, therefore the hovering is set for 1 sec, and at 0.8 sec the weapon would start flying to hand.

    But what happened is hovering > then abruptly jump position > then fly to hand.
    Result is position did not mix between 2 tween.
    How can I do that? Thank you!

    Shown in Video here


    full Code
    Code (CSharp):
    1.     public class Test_DOTween : MonoBehaviour
    2.     {
    3.        
    4.         public Transform target;
    5.  
    6.         [InspectorButton("Test")]
    7.         public bool btn;
    8.  
    9.         Sequence sequence;
    10.  
    11.         Vector3 defaultPos;
    12.         Quaternion defaultRot;
    13.  
    14.         private void Start()
    15.         {
    16.  
    17.             //move to target, intend to homing, as target can be a hand bone of character
    18.             var moveToTarget =
    19.                 DOTween.To(() => transform.position, pos=> transform.position=pos, target.position, 0.35f)
    20.                 .SetEase(Ease.InOutBack);
    21.  
    22.             //move up down 0.5 x2 = 1 sec
    23.             sequence = DOTween.Sequence()
    24.                 //reset
    25.                 .OnStart(() => {
    26.                     transform.localPosition = defaultPos;
    27.                     transform.localRotation= defaultRot;
    28.                 })
    29.                 //hover a bit
    30.                 .Insert(0f, transform.DOMoveY(1, 0.5f).SetEase(Ease.InOutQuad).SetLoops(2))
    31.                 //at 0.8 sec we move to target (intend to have some mix to previous movement, because previous stop at 1 not 0.8
    32.                 .Insert(0.8f,moveToTarget);
    33.            
    34.         }
    35.  
    36.         private void OnEnable()
    37.         {
    38.             defaultPos = transform.localPosition;
    39.             defaultRot = transform.localRotation;
    40.         }
    41.         void Test() {
    42.             sequence.Restart();
    43.             Debug.Log("Play");
    44.         }
    45.     }
     
  39. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    210
    Update
    I changed the code a bit, and it now smooth.
    My only problem now is the moveToTarget is not homing.
    That means when target (character hand bone) move, the final destination will be wrong.
    How can I implement homing behaviour?

    Code (CSharp):
    1.     public class Test_DOTween : MonoBehaviour
    2.     {
    3.        
    4.         public Transform target;
    5.  
    6.         [InspectorButton("Test")]
    7.         public bool btn;
    8.  
    9.         Sequence sequence;
    10.  
    11.         Vector3 defaultLocalPos;
    12.         Quaternion defaultLocalRot;
    13.  
    14.         private void Start()
    15.         {
    16.  
    17.             //move to target, intend to homing, as target can be a hand bone of character
    18.             var moveToTarget =
    19.                 DOTween.To(() => transform.position, pos=> transform.position=pos, target.position, 0.35f)
    20.                 .SetEase(Ease.InOutBack);
    21.  
    22.             var hover =
    23.                 DOTween.To(() => transform.position, pos => transform.position = pos, transform.parent.TransformPoint(defaultLocalPos) + Vector3.up * 0.5f, 0.5f)
    24.                 .SetEase(Ease.InOutQuad).SetLoops(2,LoopType.Yoyo);
    25.  
    26.             //move up down 0.5 x2 = 1 sec
    27.             sequence = DOTween.Sequence()
    28.                 //reset
    29.                 .OnStart(() => {
    30.                     transform.localPosition = defaultLocalPos;
    31.                     transform.localRotation= defaultLocalRot;
    32.                 })
    33.                 //hover a bit
    34.                 .Insert(0f,hover)
    35.                 //at 0.8 sec we move to target (intend to have some mix to previous movement, because previous stop at 1 not 0.8
    36.                 .Insert(0.8f,moveToTarget);
    37.            
    38.         }
    39.  
    40.         private void OnEnable()
    41.         {
    42.             defaultLocalPos = transform.localPosition;
    43.             defaultLocalRot = transform.localRotation;
    44.         }
    45.         void Test() {
    46.             sequence.Restart();
    47.             Debug.Log("Play");
    48.         }
    49.     }
     
  40. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    Played around and used Dotween to do the everything:
    * Do the countdown timer.
    * Decrement the countdown.
    * Display the message.
    * Clean-up after itself.

    Code (CSharp):
    1.                         Sequence textTween = DOTween.Sequence();
    2.  
    3.                         textTween.Append(m_FadingScreen.DOFade(1f, 0f)).
    4.                             InsertCallback(0, () => {
    5.                                 m_MessageText.text = "Battle begins in: " + countdown--;
    6.                             }).
    7.                             Append(m_FadingScreen.DOFade(0f, 1f)).SetLoops(m_BattleModeRequestCountdown + 1).
    8.                             OnComplete(() => {
    9.                                 m_FadingScreen.alpha = 0.0f;
    10.                                 m_MessageText.text = "";
    11.                             });
    12.  
    13.                         textTween.Play();
    14.  
     
  41. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    FIXED:
    Adding DOColorChar() with Join() as the last command in the sequence works.



    Having trouble getting the <animator>.DOColorChar() command to work - the color doesn't change at all.
    All the other animator-specific functions I've tried work fine.
    If I use <TMP>.DOColor(), that works to change the color of the entire text but, that's not what I'm after.

    It has something to do with other char animation tweens.
    If I use DOColorChar() on a charactoer that is not being tweened in other ways it works.

    Tweens I'm using: DOFadeChar(), DOPunchCharScale


    Thanks.
    -- Paul
     
    Last edited: Apr 3, 2023
  42. ganggeonjeong

    ganggeonjeong

    Joined:
    Feb 14, 2023
    Posts:
    1
    Hi. I have some errors in playing Dotween Exmples. I downloded DOTween examples form this site. bout some errors happened.

    error1:
    Assets\DOTween Examples\CustomPlugin Example\CustomRangePlugin.cs(64,26): error CS0115: 'CustomRangePlugin.EvaluateAndApply(NoOptions, Tween, bool, DOGetter<CustomRange>, DOSetter<CustomRange>, float, CustomRange, CustomRange, float, bool, UpdateNotice)': no suitable method found to override
    error2:
    Assets\DOTween Examples\CustomPlugin Example\CustomRangePlugin.cs(17,14): error CS0534: 'CustomRangePlugin' does not implement inherited abstract member 'ABSTweenPlugin<CustomRange, CustomRange, NoOptions>.EvaluateAndApply(NoOptions, Tween, bool, DOGetter<CustomRange>, DOSetter<CustomRange>, float, CustomRange, CustomRange, float, bool, int, UpdateNotice)'


    please help.
     
  43. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    680
    I haven't heard any response since this post from almost 2 months ago.
    @Demigiant if you're no longer offering support for this asset you need to update your Asset Store page to state so.
     
    Last edited: Apr 15, 2023
  44. UltraCoder719

    UltraCoder719

    Joined:
    Mar 19, 2023
    Posts:
    1
    I was using DoTween without problems. I bought the pro version but i keep getting errors during import. I created a new project and imported dotweenpro fresh and the same issues occur. Please help, this is driving me crazy!

    Unity version: 2021.3.22f1
    Code (CSharp):
    1. Failed to find entry-points:
    2. Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
    3.   at Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters) [0x00105] in <ebb9e4250ed24cbfa42055e3532ef311>:0
    4.   at zzzUnity.Burst.CodeGen.AssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name) [0x00039] in <a2dd15248a25411e914af2a2c82fb63f>:0
    5.   at Burst.Compiler.IL.AssemblyLoader.Resolve (Mono.Cecil.AssemblyNameReference name) [0x00079] in <a2dd15248a25411e914af2a2c82fb63f>:0
    6.   at Burst.Compiler.IL.Server.EntryPointMethodFinder.FindEntryPoints (System.String[] rootAssemblyNames, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader, Burst.Compiler.IL.NativeCompilerOptions options, Burst.Compiler.IL.Server.ProfileDelegate profileCallback, System.Boolean includeRootAssemblyReferences, System.Boolean splitTargets, Burst.Compiler.IL.Helpers.DebugLogWriter debugWriter) [0x00055] in <a2dd15248a25411e914af2a2c82fb63f>:0
    7.   at Burst.Compiler.IL.Server.FindMethodsJob.Execute (Burst.Compiler.IL.Server.CompilerServerJobExecutionContext context) [0x00133] in <a2dd15248a25411e914af2a2c82fb63f>:0
    8.  
    9. While compiling job:
    also burst seems to be stuck?
    upload_2023-4-30_20-51-32.png

    I have tried with just TextMesh Pro and same issue persist.
    upload_2023-4-30_20-52-11.png
     
  45. salmanjaved5050

    salmanjaved5050

    Joined:
    Aug 2, 2015
    Posts:
    6
    Hey! I need to tween anchored position of a rect transform but I can't find any function for that. Any help?
     
  46. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    672
    There is a DoAnchorPos() method and many other RectTransform shortcuts, but you need to make sure you have the UI module installed. (Tools/DemiGiant/DoTween Utility Panel -> Setup DOTween)
     
  47. salmanjaved5050

    salmanjaved5050

    Joined:
    Aug 2, 2015
    Posts:
    6
    Its not showing up for me.
     
  48. el_Guero

    el_Guero

    Joined:
    Sep 15, 2017
    Posts:
    148
    How can I debug this error I see in my live app in GameAnalytics in the quality section?

    Max Tweens reached: capacity has automatically been increased from 200/20 to 500/20.

    The problem I encounter is that neither in unity editor nor on device I can reproduce the error. And when I look at the active tweens while in play mode I don’t see any adding up. They all get killed when they need to be killed.

    Any ideas on how to move forward?
     
  49. el_Guero

    el_Guero

    Joined:
    Sep 15, 2017
    Posts:
    148
    Adding to the above, I tried to use DOTween.TotalPlayingTweens(); and DOTween.TotalActiveTweens(); they both show the exact same thing as the DOTween component on the [DOTween] gameobject. I have maximum 12 tweens running at the same time in my game and I kill them all after using. My initial setup is the default for 200 TW, 20 SE and I never should get even close to the full capacity of the pool.

    Is there some kind of hidden count that adds up to those 200 that I can't see?

    Or might this be a race condition which I can't reproduce on my computer or my phone? I'm thinking for example in level specific tweens that I kill before I destroy the level prefab. Maybe on low end devices it can't kill them all before it gets destroyed? But if this is the case, wouldn't I get as well a warning about the game trying to access tweens that are not existing anymore?

    Completely lost on this one. Any help is appreciated.
     
  50. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    672
    It's not only the amount of tweens currently playing that will increase the capacity.

    Are you setting up tweens in Start() or Awake() and then running them at some point later on? If so, those tweens are like any other object that gets created and stored for later use.

    But it's not an error. It's just a message letting you know that the capacity has been increased. It's possible to increase the default capacity manually. Are you having performance issues? If not, probably nothing to worry about.