Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

DOTween (HOTween v2), a Unity tween engine

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

  1. el_Guero

    el_Guero

    Joined:
    Sep 15, 2017
    Posts:
    185
    I use them with playmaker actions so neither awake nor start. But probably start is the closest as its called on enter.

    And yes. I know it’s not an error but a hyper casual game with max 12-15 tweens playing at the same time shouldn’t run into the issue of having to claim more memory for something that is not needed in the first place. Hence my interest to understand how I could potentially debug this. It’s just weird that it doesn’t happen on my side. What would You do?
     
  2. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    The best way for you to debug it is to look at the code for the playmaker action.

    My guess if that your playmaker action creates a reference to the tween when it initialises.

    So if you have a lot of objects in your scene which are using this playmaker action, even if the tweens are not yet playing, they have been created and are considered "active" by DOTween.
     
  3. el_Guero

    el_Guero

    Joined:
    Sep 15, 2017
    Posts:
    185
    If they are 'active' they should appear in the DOTween gameobject, right? So that's definitely not the case then. And no, playmaker actions run their code only when the state they are in is active. It's like any other c# script. Not because you have a dotween somewhere in your code they are automatically active, or are they? So actually what I wrote above that it's similar to the start method is not true. It's more so a custom method that gets called when the state they are in enters.
     
  4. henonchesser

    henonchesser

    Joined:
    Aug 30, 2016
    Posts:
    2
    Went to add sequences to a project today in Unity 2022.2 (and later tested in 2022.3 LTS).

    I can use most of DOTween but not sequences. When added the compiler insists no such namespace exists in DOTween.

    error CS0426: The type name 'Sequence' does not exist in the type 'DOTween'

    The line throwing the error:

    Code (CSharp):
    1. var sequence = new DOTween.Sequence();
    I've tried re-setting up DOTween, I've tried adding ASMDEF.
     
  5. steven1022

    steven1022

    Joined:
    Sep 8, 2012
    Posts:
    21
    Anyone having GUIClips errors with the upgrade to 2022.3?
     
    saifshk17 likes this.
  6. el_Guero

    el_Guero

    Joined:
    Sep 15, 2017
    Posts:
    185
    Bump. Would really like to find out the source of this. Anyone knows?
     
  7. Xentios

    Xentios

    Joined:
    Jan 15, 2019
    Posts:
    17
    is DOBlendablePunchRotation is broken?
    it moves differently from normal PunchRotation also moves the object in position?
     
  8. el_Guero

    el_Guero

    Joined:
    Sep 15, 2017
    Posts:
    185
    I got a very weird problem now with Facebook...

    DOTWEEN ► An error inside a tween callback was taken care of () ► FBAdSettingsBridgeSetAdvertiserTrackingEnabled assembly:<unknown assembly> type:<unknown type> member:(null)

    at (wrapper managed-to-native) AudienceNetwork.AdSettings.FBAdSettingsBridgeSetAdvertiserTrackingEnabled(bool)

    Then after leaving Play mode:
    DOTWEEN ► SAFE MODE ► DOTween's safe mode captured 1 errors. This is usually ok (it's what safe mode is there for) but if your game is encountering issues you should set Log Behaviour to Default in DOTween Utility Panel in order to get detailed warnings when an error is captured (consider that these errors are always on the user side).
    - 1 errors inside callbacks (these might be important)
    UnityEngine.Debug:LogWarning (object)
    DG.Tweening.Core.Debugger:LogSafeModeReport (object) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Core/Debugger.cs:80)
    DG.Tweening.Core.DOTweenComponent:OnDestroy () (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Core/DOTweenComponent.cs:156)

    Why would Dotween care about a facebook setup?
     
  9. RedZAndroidDev

    RedZAndroidDev

    Joined:
    Dec 2, 2016
    Posts:
    7
    Here is a video describing Unity Animation and DoTween usage
     
  10. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    488
    How do I loop this tween that I am doing? Since I am using OnComplete as well here, the SetLoops(-1) does not loop both functions.

    Code (CSharp):
    1. this.transform.DOScale (new Vector3 (1.3f, 1.3f, 1.3f), scaleTime).SetEase (Ease.Linear).OnComplete (() => {
    2.             this.transform.DOScale (new Vector3 (1f, 1f, 1f), scaleTime).SetEase (Ease.Linear);
    3.         }).SetLoops (-1);
     
  11. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    If you are trying to pulse the scale up and down, you don't need the nested tween. Just use

    Code (CSharp):
    1. .SetLoops(-1, LoopType.Yoyo)
    Which will play the tween in reverse before restarting.

    e.g

    Code (CSharp):
    1. this.transform.DOScale(Vector3 (1.3f, 1.3f, 1.3f), scaleTime).SetEase (Ease.Linear).SetLoops(-1, LoopType.Yoyo);
    Link to the documentation:

    http://dotween.demigiant.com/documentation.php#controls
     
    saifshk17 likes this.
  12. Ga2Z

    Ga2Z

    Joined:
    Feb 16, 2012
    Posts:
    68
    Hello, I'm having the exact same issue and I tried the OP's solution by deleting and regenerating the .sln files but it didn't work and I have no clue what it could be happening as this same script works in another project.

    I deleted and reinstalled DoTween Pro but there's no any other indication of what could be causing the error. Any help or guide is appreciated, thanks!
     
  13. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    Did you install the TMPro module in DOTween Settings?
     
  14. Ga2Z

    Ga2Z

    Joined:
    Feb 16, 2012
    Posts:
    68
    Yes, I tried doing a fresh installation in the project with the proper modules enabled but the error keeps popping up. I even made a fresh project to check and it works in every other project but this and I don't even know where to begin to search for the culprit.

    I'm on Unity 2021.3.3 HDRP by the way.
     
  15. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    Is the DOTweenTextMeshPro.cs file in your project? In the DOTweenPro folder. The DOTweenTMPAnimator class is defined in that file.
     
  16. Tom-Kazansky

    Tom-Kazansky

    Joined:
    Mar 9, 2015
    Posts:
    58
    Hello,
    I need help with Transform.DOPath
    my code: transform.DOPath(new Vector3[] { wp1, wp2 }, 1f, PathType.CatmullRom);
    dotween weird issue.jpg
    as you can see, somehow the starting position of the path is shift to some... unrelated position and I'm not sure why.
    at this time, my transform has no parent. (I unparented it before calling DOPath)

    anyone know how to solve this issue?

    my bad, it was another Tween that run at that same moment :confused:
     
    Last edited: Jul 1, 2023
  17. Ga2Z

    Ga2Z

    Joined:
    Feb 16, 2012
    Posts:
    68
    Yes it is :/
     
  18. Uncle_John

    Uncle_John

    Joined:
    Oct 7, 2017
    Posts:
    8
    I saw Daniele was interested in this. Let me know if I can help.
     

    Attached Files:

  19. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    Maybe something to do with Assembly Definitions? Definitely a weird one.
     
  20. mikitamisko

    mikitamisko

    Joined:
    Jun 2, 2023
    Posts:
    1
    Hello. Can anyone help? DoTween methods Join, Append log warnings in console in it calls before await. Here is example. How can I remove this warnings from console? Any ideas except warning suppress?
     

    Attached Files:

  21. bemlingAGI

    bemlingAGI

    Joined:
    Jan 6, 2020
    Posts:
    2
    I'm a big fan of the EaseFactory.StopMotion settings - our project has a lot of frame-by-frame animation at 24 and 12 frames per second and this helps mimic that.

    The one thing I can't seem to figure out is how to get that sort of DoTween easing to work in lockstep with Unity's built-in frame-by-frame animation. Like, I have a 2D character DoTweening its transform's x position left to right, and the Animator running the walk cycle PNG sequence - how do I get it so the walk cycle updates on the same "frame" as the DoTween's stop motion update?
     
  22. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    Have you tried using a DOVirtual.Int or DOVirtual.EasedValue using the same EaseFactory.StopMotion settings and using the result to set the PNG index of the sprite renderer manually?
     
  23. Grelle_IA

    Grelle_IA

    Joined:
    May 15, 2023
    Posts:
    5
    Hello there; I and my colleagues wonder about one thing.
    Look!
    We have some List of objects do to some tween with it.

    In case of foreach we create tween for each list element.
    Code (CSharp):
    1. _list.ForEach (a => a.DoMove(value, time));
    Also we have opportunity to do it with one tween, using Dotween.To (for example, or Dotween.Float), where we change value in callback.
    Code (CSharp):
    1. Dotween.To (
    2.   () =>startValue,
    3.   newValue => _list.Foreach (a => a.position = newValue),
    4.   endValue,
    5.   time).
    In that case we read list every update, but have one tween.

    And question is:
    Which of this case is more effective at performance? Or may be it depends on list size? What about 5 elements? 10? 100?
     
  24. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    Hello I have this really annoying issue where initializing a sequence with DOTween.Sequence() does not run the sequence.
    However if I leave the Sequence as null, the sequence runs properly.

    What could be happening?


    Code (CSharp):
    1.       Sequence seq = null;
    2.  
    3.         // if I initialize the sequence like this, the sequence calls OnPlay and OnComplete but the animations are not executed.
    4.         // however if I keep the sequence null, I get a warning, the 2 callbacks and the sequence animations run properly.
    5.         // What's going on!?
    6.         // seq = DOTween.Sequence();
    7.         // seq.Pause();
    8.  
    9.         for (var i = 0; i < Rows.Count; i++)
    10.         {
    11.             var row = Rows[i];
    12.  
    13.             var tween = row.Anim_DoHighlight(i == activeRowIndex, animating).SetDelay(delay);
    14.  
    15.             seq.Append(tween);
    16.         }
    17.  
    18.         seq.OnPlay(() => Debug.LogError($"Playing @ {Time.time}"));
    19.         seq.OnComplete(() => Debug.Log("Finished @ {Time.time}"));
    20.        
    21.         seq.Play();


    Code (CSharp):
    1.     public Tween Anim_DoHighlight(bool _on, bool _append)
    2.     {
    3.         // if (!ALLOW_ANIMATE) return null;
    4.  
    5.         float duration = Database.AnimSettings.RowHighlightSizeDuration;
    6.         var displaySettings = Database.DisplaySettings;
    7.  
    8.         var targetHeight = _on ? displaySettings.Row_HighlightHeight : displaySettings.Row_MinHeight;
    9.  
    10.         var ease = Database.AnimSettings.RowHighlightEase;
    11.         var tween = DOVirtual.Float(LayoutElement.minHeight, targetHeight, duration, OnMinHeightUpdate)
    12.             .SetEase(ease);
    13.  
    14.         Debug.Log($"Anim_DoHighlight {_on} on Board of {Grid.Fieldmaster.name} @ Row {GetIndex()}\n Height: {targetHeight}");
    15.        
    16.         return tween;
    17.     }
    18.    
    19.  
    20.     private void OnMinHeightUpdate(float _height)
    21.     {
    22.         Debug.Log($"updating Row #{GetIndex()}: {_height}");
    23.         LayoutElement.minHeight = _height;
    24.     }
     
  25. sunsetworld

    sunsetworld

    Joined:
    Jul 21, 2020
    Posts:
    23
    I'm working on a game that involves screen shaking. I've tried to use DOTween to get the shaking to work. However, the shake only occurs the first time and not any other subsequent times.

    Code (CSharp):
    1.  
    2. using System;
    3. using System.Collections;
    4. using Unity.Mathematics;
    5. using UnityEngine;
    6. using UnityEngine.InputSystem;
    7. using DG.Tweening;
    8.  
    9. public class CrabCam : MonoBehaviour
    10. {
    11.     private Rigidbody _crabCamRb;
    12.     private Camera _playerCamera;
    13.     [SerializeField] private Transform playerTransform;
    14.  
    15.     [SerializeField] private Vector3 camOffset;
    16.     [SerializeField] private float turnSmoothTime = 0.1f;
    17.     private float _turnSmoothVelocity;
    18.  
    19.     private Vector2 _mouseVelocity;
    20.  
    21.     [Range(1f, 200f)] [SerializeField] private float xSensitivity = 1f;
    22.  
    23.     [Range(1f, 200f)] [SerializeField] private float ySensitivity = 1f;
    24.  
    25.     private CrabMovement _crabMovement;
    26.  
    27.     [SerializeField] private float smoothTime = 0.1f;
    28.  
    29.     [SerializeField] private float minXClamp = -20;
    30.     [SerializeField] private float maxXClamp = 90;
    31.  
    32.     private float _maxDepth;
    33.  
    34.     private GameManager _gameManager;
    35.  
    36.     private Tween _camShakeTween;
    37.  
    38.     private void Start()
    39.     {
    40.         DOTween.Init(true, false, LogBehaviour.Default);
    41.         _crabMovement = FindObjectOfType<CrabMovement>();
    42.         _crabCamRb = GetComponent<Rigidbody>();
    43.         _gameManager = FindObjectOfType<GameManager>();
    44.         _maxDepth = _gameManager.GetMaxDepth();
    45.         camOffset = Camera.main.transform.position;
    46.     }
    47.  
    48.     // Update is called once per frame
    49.     void Update()
    50.     {
    51.         if (transform.position.y >= _maxDepth) transform.position = playerTransform.position;
    52.     }
    53.  
    54.     public void RotateCamera(InputAction.CallbackContext context)
    55.     {
    56.         if (transform.position.y >= _maxDepth)
    57.         {
    58.             _mouseVelocity = context.ReadValue<Vector2>();
    59.             _mouseVelocity *= new Vector2(xSensitivity, ySensitivity) * Time.deltaTime;
    60.             _mouseVelocity.x = Mathf.Clamp(_mouseVelocity.x, minXClamp, maxXClamp);
    61.             _crabCamRb.transform.Rotate(_mouseVelocity.y, _mouseVelocity.x, _crabCamRb.transform.rotation.z);
    62.             _crabCamRb.transform.eulerAngles =
    63.                 new Vector3(_crabCamRb.transform.eulerAngles.x, _crabCamRb.transform.eulerAngles.y, 0f);
    64.         }
    65.  
    66.     }
    67.     public void ShakeCamera()
    68.     {
    69.         _camShakeTween = transform.DOShakePosition(1f, 3f, 10, 90f, false, false, ShakeRandomnessMode.Full);
    70.         _crabMovement.SetHasTouchedRamp(false);
    71.     }
    72.  
    73.     public float GetCurrentCamYPos()
    74.     {
    75.         return _crabCamRb.transform.eulerAngles.y;
    76.     }
    77. }
    CrabMovement.

    Code (CSharp):
    1.    
    2. private void OnCollisionExit(Collision other)
    3.     {
    4.         if (other.gameObject.CompareTag("Ramp") && !_hasTouchedRamp)
    5.         {
    6.             _hasTouchedRamp = true;
    7.         }
    8.     }
    9.  
    10.     private void OnCollisionEnter(Collision other)
    11.     {
    12.         if (_hasTouchedRamp && other.gameObject.CompareTag("Floor"))
    13.         {
    14.             _crabCam.ShakeCamera();
    15.         }
    16.     }
    17.  
    I've added the whole CrabCam script for context and the script that calls the ShakeCamera function but this is the function that I think is causing the problem.

    Code (CSharp):
    1.     public void ShakeCamera()
    2.     {
    3.         _camShakeTween = transform.DOShakePosition(1f, 3f, 10, 90f, false, false, ShakeRandomnessMode.Full);
    4.         _crabMovement.SetHasTouchedRamp(false);
    5.     }
    How can I fix it to ensure that it works more than once?

    Thanks.
     
  26. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    I think it might be your collision code that's the issue. If you want to know when the crab touches the ramp, shouldn't that be in OnCollisionEnter rather than Exit? Or do you mean to check against the "Floor" tag in OnCollisionExit?

    i.e.

    Code (CSharp):
    1.  
    2.     private void OnCollisionEnter(Collision other)
    3.     {
    4.         if(other.gameObject.CompareTag("Ramp")
    5.         {
    6.           _hasTouchedRamp = true;
    7.         }
    8.  
    9.         if (_hasTouchedRamp && other.gameObject.CompareTag("Floor"))
    10.         {
    11.             _crabCam.ShakeCamera();
    12.         }
    13.     }
    Might just be misunderstanding your intention.

    The best way to debug this is to just call the ShakeCamera method manually several times and see if it works. Then at least you know the problem isn't with that method.
     
  27. jacknero

    jacknero

    Joined:
    Aug 15, 2018
    Posts:
    60
    Hi there!
    I've got a UWP build error since I updated my project to 2023.1.
    And now, I've confirmed it is caused by the Dotween.
    It seems Dotween is not compatible with 2023.1's UWP build, please check it, thanks!
    Here's the error log:
    Code (CSharp):
    1. D:\Program Files\Unity3\2023.1.6f1\Editor\Data\il2cpp\build\deploy\il2cpp.exe @Library\Bee\artifacts\rsp\13884116253094243575.rsp
    2.  
    3. Error: IL2CPP error (no further information about what managed code was being converted is available)
    4. System.AggregateException: One or more errors occurred. (Value cannot be null. (Parameter 'document'))
    5.  
    6. ---> System.ArgumentNullException: Value cannot be null. (Parameter 'document')
    7.  
    8.    at Mono.Cecil.Cil.SequencePoint..ctor(Int32, Document) + 0x7e
    9.  
    10.    at Mono.Cecil.SignatureReader.ReadSequencePoints(Document) + 0x1b4
    11.  
    12.    at Mono.Cecil.MetadataReader.ReadSequencePoints(MethodDefinition) + 0x1b8
    13.  
    14.    at Mono.Cecil.Cil.PortablePdbReader.Read(MethodDefinition) + 0x3d
    15.  
    16.    at Mono.Cecil.Cil.CodeReader.ReadMethodBody() + 0xa7
    17.  
    18.    at Mono.Cecil.Cil.CodeReader.ReadMethodBody(MethodDefinition) + 0x4a
    19.  
    20.    at Mono.Cecil.ModuleDefinition.Read[TItem, TRet](TRet&, TItem, Func`3) + 0x5d
    21.  
    22.    at Mono.Cecil.MethodDefinition.get_Body() + 0xe4
    23.  
    24.    at Unity.IL2CPP.DataModel.BuildLogic.CecilLoading.CecilAssemblyLoader.ImmediateRead(UnderConstruction`2) + 0x129
    25.  
    26.    at Unity.IL2CPP.DataModel.BuildLogic.DataModelBuilder.<>c__DisplayClass18_0.<BuildCecilSourcedData>b__0(UnderConstruction`2 asm) + 0x2ed
    27.  
    28.    at Unity.IL2CPP.DataModel.BuildLogic.Utils.ParallelHelpers.<>c__DisplayClass6_0`2.<MapParallel>b__0(ValueTuple`2 item) + 0x25
    29.  
    30.    at System.Threading.Tasks.Parallel.<>c__DisplayClass44_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) + 0x279
    31.  
    32. --- End of stack trace from previous location ---
    33.  
    34.    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
    35.  
    36.    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception) + 0x13
    37.  
    38.    at System.Threading.Tasks.Parallel.<>c__DisplayClass44_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) + 0x630
    39.  
    40.    at System.Threading.Tasks.TaskReplicator.Replica.Execute() + 0x3a
    41.  
    42.    --- End of inner exception stack trace ---
    43.  
    44.    at System.Threading.Tasks.TaskReplicator.Run[TState](TaskReplicator.ReplicatableUserAction`1, ParallelOptions, Boolean) + 0x15d
    45.  
    46.    at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource, TLocal](Partitioner`1, ParallelOptions, Action`1, Action`2, Action`3, Func`4, Func`5, Func`1, Action`1) + 0x23f
    47.  
    48. --- End of stack trace from previous location ---
    49.  
    50.    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
    51.  
    52.    at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection, CancellationToken, Exception) + 0x31
    53.  
    54.    at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource, TLocal](Partitioner`1, ParallelOptions, Action`1, Action`2, Action`3, Func`4, Func`5, Func`1, Action`1) + 0x3e0
    55.  
    56.    at Unity.IL2CPP.DataModel.BuildLogic.DataModelBuilder.BuildCecilSourcedData(ReadOnlyCollection`1, ReadOnlyCollection`1&) + 0x2c3
    57.  
    58.    at Unity.IL2CPP.DataModel.BuildLogic.DataModelBuilder.Build() + 0x62
    59.  
    60.    at Unity.IL2CPP.AssemblyConversion.Phases.InitializePhase.Run(AssemblyConversionContext) + 0x32f
    61.  
    62.    at Unity.IL2CPP.AssemblyConversion.Classic.ClassicConverter.Run(AssemblyConversionContext) + 0x11
    63.  
    64.    at Unity.IL2CPP.AssemblyConversion.AssemblyConverter.ConvertAssemblies(AssemblyConversionContext, ConversionMode) + 0x24
    65.  
    66.    at Unity.IL2CPP.AssemblyConversion.AssemblyConverter.ConvertAssemblies(TinyProfiler2, AssemblyConversionInputData, AssemblyConversionParameters, AssemblyConversionInputDataForTopLevelAccess) + 0x17f
    67. *** Tundra build failed (11.95 seconds), 138 items updated, 2424 evaluated
    68. D:\Program Files\Unity3\2023.1.6f1\Editor\Data\il2cpp\build\deploy\il2cpp.exe @Library\Bee\artifacts\rsp\13884116253094243575.rsp
    69. Error: IL2CPP error (no further information about what managed code was being converted is available)
    70. System.AggregateException: One or more errors occurred. (Value cannot be null. (Parameter 'document'))
    71. ---> System.ArgumentNullException: Value cannot be null. (Parameter 'document')
    72.    at Mono.Cecil.Cil.SequencePoint..ctor(Int32, Document) + 0x7e
    73.    at Mono.Cecil.SignatureReader.ReadSequencePoints(Document) + 0x1b4
    74.    at Mono.Cecil.MetadataReader.ReadSequencePoints(MethodDefinition) + 0x1b8
    75.    at Mono.Cecil.Cil.PortablePdbReader.Read(MethodDefinition) + 0x3d
    76.    at Mono.Cecil.Cil.CodeReader.ReadMethodBody() + 0xa7
    77.    at Mono.Cecil.Cil.CodeReader.ReadMethodBody(MethodDefinition) + 0x4a
    78.    at Mono.Cecil.ModuleDefinition.Read[TItem, TRet](TRet&, TItem, Func`3) + 0x5d
    79.    at Mono.Cecil.MethodDefinition.get_Body() + 0xe4
    80.    at Unity.IL2CPP.DataModel.BuildLogic.CecilLoading.CecilAssemblyLoader.ImmediateRead(UnderConstruction`2) + 0x129
    81.    at Unity.IL2CPP.DataModel.BuildLogic.DataModelBuilder.<>c__DisplayClass18_0.<BuildCecilSourcedData>b__0(UnderConstruction`2 asm) + 0x2ed
    82.    at Unity.IL2CPP.DataModel.BuildLogic.Utils.ParallelHelpers.<>c__DisplayClass6_0`2.<MapParallel>b__0(ValueTuple`2 item) + 0x25
    83.    at System.Threading.Tasks.Parallel.<>c__DisplayClass44_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) + 0x279
    84. --- End of stack trace from previous location ---
    85.    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
    86.    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception) + 0x13
    87.    at System.Threading.Tasks.Parallel.<>c__DisplayClass44_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) + 0x630
    88.    at System.Threading.Tasks.TaskReplicator.Replica.Execute() + 0x3a
    89.    --- End of inner exception stack trace ---
    90.    at System.Threading.Tasks.TaskReplicator.Run[TState](TaskReplicator.ReplicatableUserAction`1, ParallelOptions, Boolean) + 0x15d
    91.    at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource, TLocal](Partitioner`1, ParallelOptions, Action`1, Action`2, Action`3, Func`4, Func`5, Func`1, Action`1) + 0x23f
    92. --- End of stack trace from previous location ---
    93.    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
    94.    at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection, CancellationToken, Exception) + 0x31
    95.    at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource, TLocal](Partitioner`1, ParallelOptions, Action`1, Action`2, Action`3, Func`4, Func`5, Func`1, Action`1) + 0x3e0
    96.    at Unity.IL2CPP.DataModel.BuildLogic.DataModelBuilder.BuildCecilSourcedData(ReadOnlyCollection`1, ReadOnlyCollection`1&) + 0x2c3
    97.    at Unity.IL2CPP.DataModel.BuildLogic.DataModelBuilder.Build() + 0x62
    98.    at Unity.IL2CPP.AssemblyConversion.Phases.InitializePhase.Run(AssemblyConversionContext) + 0x32f
    99.    at Unity.IL2CPP.AssemblyConversion.Classic.ClassicConverter.Run(AssemblyConversionContext) + 0x11
    100.    at Unity.IL2CPP.AssemblyConversion.AssemblyConverter.ConvertAssemblies(AssemblyConversionContext, ConversionMode) + 0x24
    101.    at Unity.IL2CPP.AssemblyConversion.AssemblyConverter.ConvertAssemblies(TinyProfiler2, AssemblyConversionInputData, AssemblyConversionParameters, AssemblyConversionInputDataForTopLevelAccess) + 0x17f
    102. UnityEngine.StackTraceUtility:ExtractStackTrace ()
     
  28. VOXELIUM

    VOXELIUM

    Joined:
    Nov 24, 2022
    Posts:
    48
    Can you help me why it's not possible to start a tween animation from another object?
    If I run the RocketFly() method in Start the tween animation works well.
    But i run method RocketFly() from other class... tween animation does not work.

    Debug.Log(flightStop.position) reports that the method RocketFly() itself is being run but the tween animation does not

    I should clarify that the Class in which the RocketFly() method is located is not on the playing field when the game starts. He's spawning. Probably the problem is because of this.

    Code (CSharp):
    1.  
    2. private Tween tweenFlight;
    3. private Transform flightStop;
    4.  
    5.     private void Start()
    6.     {
    7.         flightStop = FindObjectOfType<flightStop>().transform;
    8.     }
    9.  
    10.  
    11.     public void RocketFly()
    12.     {
    13.         Debug.Log(flightStop.position);
    14.  
    15.         tweenFlight = transform.DOMove(flightStop.position, 2f).SetEase(Ease.Linear);
    16.     }
    17.  
     
  29. jschalky

    jschalky

    Joined:
    May 9, 2020
    Posts:
    6
    Hi. I am using the path component. I am using it at quite a large scale. When moving an object on the path, looking at the edges of object as it move around the path it is jittery. Anyway to smooth it out. Increasing the duration does help but i need to move relatively fast.
    Thanks
     
  30. sdtr443w

    sdtr443w

    Joined:
    Nov 29, 2014
    Posts:
    23
    If I start a tween using DoMove off of a GameObject's Transform, is that updating in FixedUpdate? I am assuming so but I wanted to double check. I wanted to refresh another GameObject's position relative to the object when the tween runs, and I found I had to refresh it during FixedUpdate instead of Update or even onTriggerStay.

    Edit: I saw I could force it to use Update(), which somehow got the same logic to work on onTriggerStay (I was screwing around and the logic is a little cleaner there anyways). I am guessing that FixedUpdate was the default? Is there a way to query that stuff from a tween?
     
    Last edited: Aug 25, 2023
  31. Riff-Rex

    Riff-Rex

    Joined:
    Mar 14, 2014
    Posts:
    19
    Hi, I have a looping closed path for an object meant to "flee" from the player who is detected with two triggers: one at the object's "front" and one at its "back". The trigger to its back correctly sets it moving forward along the path but the trigger at its front, which is supposed to make it go backwards does nothing because as I understand it there is no "backwards" to go back to as the path is at it origin. Is there a way around this? To make a looping path that ignores this start/end position state?

    upload_2023-8-31_22-37-1.png
     
  32. HarryChew

    HarryChew

    Joined:
    Jun 22, 2023
    Posts:
    1
    interpretative dance XD
     
  33. AbsolutelyLloyd

    AbsolutelyLloyd

    Joined:
    Jun 16, 2021
    Posts:
    2
    Hey all,

    Question I've been stumped by, is there a method by which we can have a sequence wait for an await? Using UniTask, I'm calling from my Dotween Sequence an awaitable function, but I can only find details on returning a tween as awaitable or converting a tween to a task, rather than having my tween/sequence wait for an awaitable task.
     
  34. AntLewis

    AntLewis

    Joined:
    Feb 2, 2010
    Posts:
    254
    Hey there, question about a sequence. I've been trying to detect if a sequency is running, but it always reports false. To test, I wrote this quick test:

    Code (CSharp):
    1.    
    2.     private void Awake()
    3.     {
    4.         openDoorSequence = DOTween.Sequence();
    5.     }
    6.  
    7.  public void StartOpening()
    8.     {
    9.         openDoorSequence.Append(transform.DORotate(new Vector3(0f, 90f, 0), rotationTime));
    10.         Debug.LogFormat("OpenSequence in STARTOPENING status is {0}", openDoorSequence.IsPlaying() );
    11.     }
    So as soon as the sequence starts, openDoorSequence.IsPlaying() is returning false. Why is that?

    Thanks for any help!
     
  35. AntLewis

    AntLewis

    Joined:
    Feb 2, 2010
    Posts:
    254
    Apparently I need to

    Apparently I need to declare the sequence right before I use it, to get expected results...
     
  36. fieldplayz

    fieldplayz

    Joined:
    Oct 31, 2021
    Posts:
    1
    Hey i have a problem with DoRotate. It doesn't rotate at all. I thought maybe it was every dotween fucntion but DoMove did work when i tried that. Did i do something wrong in the code?
    Code (CSharp):
    1. using DG.Tweening;
    2. using UnityEngine;
    3.  
    4.  
    5. public class Interactable : MonoBehaviour
    6. {
    7.     public interactables interactables;
    8.     public Transform doorHinge;
    9.  
    10.     public void Interact()
    11.     {
    12.         switch (interactables)
    13.         {
    14.             case interactables.Door:
    15.                 DoorInteract();
    16.                 break;
    17.             case interactables.Key:
    18.                 break;
    19.         }
    20.     }
    21.  
    22.     private void DoorInteract()
    23.     {
    24.         transform.DORotate(new Vector3(0, 60, 0), 1, RotateMode.FastBeyond360).SetEase(Ease.Linear).SetLoops(-1, LoopType.Restart);
    25.         Debug.Log("Open Door");
    26.     }
    27. }
     
  37. pegasusearl

    pegasusearl

    Joined:
    Jul 3, 2017
    Posts:
    3
    hello, can anyone assist me in using DOTween? I might be misunderstand `sequence`

    ```
    sequence.Append( cameraPivot.DOMove(entrance.position, 1f).SetEase(Ease.InOutCubic) );
    sequence.Append(cameraPivot.DORotateQuaternion(entrance.rotation, 0.4f).SetEase(Ease.InCubic));
    sequence.Append(cameraPivot.DOMove(exit.position, 1f).SetEase(Ease.InOutCubic));

    sequence.Append(cameraPivot.DOMoveY(playerCamera.position.y, 0.4f).SetEase(Ease.InElastic));
    sequence.Join(cameraPivot.DOMoveX(playerCamera.position.x, 0.4f).SetEase(Ease.Linear));
    sequence.Join(cameraPivot.DOMoveZ(playerCamera.position.z, 0.4f).SetEase(Ease.Linear));
    ```

    Documentation said they should run in sequence (except for the last two) but no, they all ran at the same time. Why?

    even if I didn't ran the last two, it still ran at the same time.
     
  38. unity_9C25CFD21225E575BC43

    unity_9C25CFD21225E575BC43

    Joined:
    Sep 18, 2023
    Posts:
    1
    Hey guys, i have this error : Dotween component.update error. Its i'm wrong or the dotween component is destroyed ?
     
  39. palanolho_unity

    palanolho_unity

    Joined:
    Jun 20, 2022
    Posts:
    4
    Hi, I'm having some problems with DoTween Pro.

    When I add the DoTween component to an object and choose to rotate it, it has a weird behaviour.

    Problem 1
    I have an object (a cog)and I want to rotate it like it's rolling, but no matter the config I do it never rotates how I would expect.

    Please have a look ar the video in the link. I show the problem and talk about it.
    https://app.screencast.com/cW3sJ1itvLTMA

    Problem 2
    I wrote a script using the DoTween Free to animate some objects, very simple script, that applies the rotate on the selected axis. However, after installing the DoTween Pro ver, it started having weird behaviour on new objects I attach it.


    This is an object I attached the script while I had only DoTween Free
    https://app.screencast.com/L6aEUnZJGbiwz

    This is an object I attached the exact same script after installing DoTween Pro
    https://app.screencast.com/OiSjILhV2oCou

    Script code
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using DG.Tweening;
    5.  
    6. public class RotateTween : MonoBehaviour
    7. {
    8.     public LoopType rotateLoopType;
    9.     public Ease rotateEaseType;
    10.     public float rotateTime = 0;
    11.     public Vector3 rotateAngle = new Vector3 (0, 0, 0);
    12.  
    13.     public LoopType floatLoopType;
    14.     public Ease floatEaseType;  
    15.     public float floatTime;
    16.     private Vector3 originPosition;
    17.     public Vector3 floatIncrement = new Vector3 (0, 0, 0);
    18.  
    19.     void Start()
    20.     {
    21.         originPosition = transform.position;
    22.        
    23.         transform.DORotate(rotateAngle, rotateTime * 0.5f, RotateMode.FastBeyond360).SetLoops(-1, rotateLoopType).SetEase(rotateEaseType);
    24.         transform.DOMove(originPosition + floatIncrement, floatTime * 0.5f).SetLoops(-1, floatLoopType).SetEase(floatEaseType);
    25.        
    26.        
    27.     }
    28.  
    29. }
    30.  
    Does anyone have any idea what is going on? :S
    Many thanks in advance.
     
  40. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    Didn’t watch the videos sorry, but if you are having weird rotations and you want something to spin like a cog, I would use

    RotateMode.LocalAxisAdd
    Or
    RotateMode.WorldAxisAdd
     
  41. _eternal

    _eternal

    Joined:
    Nov 25, 2014
    Posts:
    303
    Copy-pasting here since the dev never replied.

    I was profiling something recently, and I came across a performance issue that might be either a bug or an oversight.

    I have a bunch of Rigidbody2Ds that I'm moving along a path (doesn't seem to matter whether it's Catmull-Rom or Bezier). If I chain a SetLookAt function to DOLocalPath, this results in a lot of time spent in Physics2D.SyncTransformChanges. I'm guessing that SetLookAt is modifying the transform's rotation rather than the rigidbody's.

    I reproduced the bug in a demo project, and I was able to fix it in my main project by setting each object's rotation myself:
    rBody.SetRotation(Quaternion.LookRotation(transform.forward, moveDelta));


    In this case, I was already getting the objects' move delta every frame, so it was easier to do this in main project than in the test project. Either way, if I'm not mistaken, I think it would be more performant to do something like this, rather than to modify the transform and have Unity spend time re-syncing it.

    This is working for me right now, but hopefully the dev updates it at some point.
     
  42. frankierozsa

    frankierozsa

    Joined:
    Dec 13, 2019
    Posts:
    1
    I had an issue with some functionality when using SetLoops(-1, LoopType.Incremental) and I am really unsure on why this was the case. I was wondering if someone would be able to help me understand?

    I use a sequence with DOLocalRotate with incremental looping. and the object loops just fine on a rotation with -2 on the z axis (object's original rotation is 0,0,0). Then lets I switch menu so the object that was animating is now disabled, and let say that object's rotation is now 0,0,-60 (because thats when the sequence was killed and I am not resetting the object's rotation)
    Now, if I were to call the animation function again and remake a new sequence calling DOLocalRotate again with incremental loops, the rotation happens extremely quickly and erratically, and it's very unclear to me why, shouldn't the animation simply do the looping rotation again with the value -2 from the object's rotation (which would be 0,0-60 now)?

    Let me clarify that I fixed this issue by resetting the object's rotation back to its original rotation (0,0,0) and this is just fine as a fix, but why would the looping animation act so strangely if the rotation it starts from again, is different?

    Hopefully my question is clear
     
  43. Adam_Benko

    Adam_Benko

    Joined:
    Jun 16, 2018
    Posts:
    103
    Hi. I am using dotween and I have realized that floating origin (shifting method of the camera) doesnt move the tweener , so the object that is animated stays at the same place whereas everything in the scene snaps on floating origin trigger.

    Is there a way to move the object that holds the tweeners too ? If I could, the animation would move with the rest of the world and would appear to work right.
    (floating origin moves the entire world except the player by the amount that the player has moved once he reaches a certain threshold. Once this happens, everything moves except the tweened animation)

    I am using DoMove method. DoLocalMove doesnt work too
     
  44. schwips

    schwips

    Joined:
    Apr 23, 2019
    Posts:
    1
    Hello

    I upgraded my unity android game to unity 2021.
    After that, DOMove() no longer runs so smoothly as before.

    Has anyone had the same experience? Any suggestions or tips?

    Thanks
     
    KyryloKuzyk likes this.
  45. batvink

    batvink

    Joined:
    Sep 26, 2019
    Posts:
    61
    Has anyone seen the log warning below? It's not a blocker but it's a bit irritating. It started happening when I added a Progressor from the Doozy UI package. It's very likely a Doozy issue, but there is no chance of support on that side of the issue...so I'm hoping somebody here has seen it :)

    "you can't add elements to a null sequence"

    upload_2024-2-7_8-32-37.png

    Code (CSharp):
    1. UnityEngine.Debug:LogWarning (object)
    2. DG.Tweening.Core.Debugger:LogWarning (object,DG.Tweening.Tween) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Core/Debugger.cs:40)
    3. DG.Tweening.Core.Debugger/Sequence:LogAddToNullSequence () (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/Core/Debugger.cs:195)
    4. DG.Tweening.TweenSettingsExtensions:ValidateAddToSequence (DG.Tweening.Sequence,DG.Tweening.Tween,bool) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/TweenSettingsExtensions.cs:593)
    5. DG.Tweening.TweenSettingsExtensions:Append (DG.Tweening.Sequence,DG.Tweening.Tween) (at D:/DG/_Develop/__UNITY3_CLASSES/_Holoville/__DOTween/_DOTween.Assembly/DOTween/TweenSettingsExtensions.cs:501)
    6. Doozy.Engine.Progress.Progressor:SetValue (single,bool) (at Assets/Doozy/Engine/Progress/Progressor.cs:275)
    7. Doozy.Engine.Progress.Progressor:SetValue (single) (at Assets/Doozy/Engine/Progress/Progressor.cs:247)
    8. Unity.VisualScripting.InstanceActionInvoker`2<Doozy.Engine.Progress.Progressor, single>:InvokeUnsafe (object,object) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Core/Reflection/Optimization/InstanceActionInvoker_1.cs:51)
    9. Unity.VisualScripting.InstanceActionInvoker`2<Doozy.Engine.Progress.Progressor, single>:Invoke (object,object) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Core/Reflection/Optimization/InstanceActionInvoker_1.cs:32)
    10. Unity.VisualScripting.Member:Invoke (object,object) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Core/Reflection/Member.cs:951)
    11. Unity.VisualScripting.InvokeMember:Invoke (object,Unity.VisualScripting.Flow) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Flow/Framework/Codebase/InvokeMember.cs:312)
    12. Unity.VisualScripting.InvokeMember:Enter (Unity.VisualScripting.Flow) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Flow/Framework/Codebase/InvokeMember.cs:404)
    13. Unity.VisualScripting.Flow:InvokeDelegate (Unity.VisualScripting.ControlInput) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Flow/Flow.cs:451)
    14. Unity.VisualScripting.Flow:Invoke (Unity.VisualScripting.ControlOutput) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Flow/Flow.cs:347)
    15. Unity.VisualScripting.Flow:Invoke (Unity.VisualScripting.ControlOutput) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Flow/Flow.cs:351)
    16. Unity.VisualScripting.Timer:Update (Unity.VisualScripting.Flow) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Flow/Framework/Time/Timer.cs:274)
    17. Unity.VisualScripting.Timer:TriggerUpdate (Unity.VisualScripting.GraphReference) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Flow/Framework/Time/Timer.cs:187)
    18. Unity.VisualScripting.Timer/<>c__DisplayClass55_0:<StartListening>b__0 (Unity.VisualScripting.EmptyEventArgs) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Flow/Framework/Time/Timer.cs:157)
    19. Unity.VisualScripting.EventBus:Trigger<Unity.VisualScripting.EmptyEventArgs> (Unity.VisualScripting.EventHook,Unity.VisualScripting.EmptyEventArgs) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Core/Events/EventBus.cs:71)
    20. Unity.VisualScripting.EventMachine`2<Unity.VisualScripting.StateGraph, Unity.VisualScripting.StateGraphAsset>:TriggerRegisteredEvent<Unity.VisualScripting.EmptyEventArgs> (Unity.VisualScripting.EventHook,Unity.VisualScripting.EmptyEventArgs) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Core/Events/EventMachine.cs:35)
    21. Unity.VisualScripting.EventMachine`2<Unity.VisualScripting.StateGraph, Unity.VisualScripting.StateGraphAsset>:TriggerEvent (string) (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Core/Events/EventMachine.cs:13)
    22. Unity.VisualScripting.EventMachine`2<Unity.VisualScripting.StateGraph, Unity.VisualScripting.StateGraphAsset>:Update () (at ./Library/PackageCache/com.unity.visualscripting@1.8.0/Runtime/VisualScripting.Core/Events/EventMachine.cs:74)
     
  46. liyuanyegm

    liyuanyegm

    Joined:
    Feb 22, 2023
    Posts:
    1
    Hi.
    Sequence sequence = DG.Tweening.DOTween.Sequence();
    sequence.AppendCallback(()=> {
    Debug.Log("Callback1");
    sequence.Pause();
    });
    sequence.AppendInterval(0.33f); // interval time
    sequence.AppendCallback(() => { Debug.Log("Callback2"); });
    int result = 0;
    // for loop time cost is about 1.2 seconds
    for (int i = 0; i < 610000000 * 2; i++)
    {
    result = (result + 1) / 2;
    }

    if interval time <= 0.33, then output is Callback1 and Callback2; if interval time > 0.33, then output is Callback1 only;
    I am confused by the results.
    does anyone know why
     
    KyryloKuzyk likes this.
  47. Razputin

    Razputin

    Joined:
    Mar 31, 2013
    Posts:
    356
    I'm new to this plugin, so dumb question, what am I doing wrong here, I can't seem to get any of the methods to work at all... Example, both of these do nothing.


    Code (CSharp):
    1.          
    2.  RectTransform rect = CanvasManager.instance.moneyInputGameobject.GetComponent<RectTransform>();
    3.             rect.DOShakeAnchorPos(1);
    4.  
    Code (CSharp):
    1.        
    2. RectTransform rect = CanvasManager.instance.moneyInputGameobject.GetComponent<RectTransform>();
    3.  rect.DOMove(new Vector3(10000,10000));
    4.  
     
  48. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
  49. Razputin

    Razputin

    Joined:
    Mar 31, 2013
    Posts:
    356
    Yeah autoplay is set to all, and I've also tried actually calling .Play() as well just to be safe, but nothing.
     
  50. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    Well in both of your examples you haven’t set a duration for the tween. You need to supply a second parameter, otherwise the tween probably is getting set with a default duration of 0