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. 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:
    168
    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:
    729
    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:
    168
    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:
    1
    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:
    168
    Bump. Would really like to find out the source of this. Anyone knows?
     
  7. Xentios

    Xentios

    Joined:
    Jan 15, 2019
    Posts:
    15
    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:
    168
    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:
    6
    Here is a video describing Unity Animation and DoTween usage
     
  10. saifshk17

    saifshk17

    Joined:
    Dec 4, 2016
    Posts:
    487
    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:
    729
    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:
    67
    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:
    729
    Did you install the TMPro module in DOTween Settings?
     
  14. Ga2Z

    Ga2Z

    Joined:
    Feb 16, 2012
    Posts:
    67
    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:
    729
    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:
    55
    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:
    67
    Yes it is :/
     
  18. Uncle_John

    Uncle_John

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

    Attached Files:

  19. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    729
    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:
    729
    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:
    4
    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:
    974
    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:
    729
    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:
    59
    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:
    37
    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:
    4
    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:
    239
    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:
    239
    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.