Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

DOTween (HOTween v2), a Unity tween engine

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

  1. theDawckta

    theDawckta

    Joined:
    Jun 16, 2014
    Posts:
    48
    Hi, can someone help please. I am starting a DoPath tween like so;
    Code (CSharp):
    1. Tween myTween = Death.transform.DOPath(_deathMarchWayoints.ToArray(), 5f, PathType.Linear, PathMode.Full3D, 10, Color.green).SetSpeedBased();
    but the waypoints will change as the game goes on, how can i update _deathMarchWayPoints and have the tween carry on its merry way?

    Thanks!
     
  2. Tycellent

    Tycellent

    Joined:
    Nov 7, 2014
    Posts:
    26
    What's the best way to move a UI gameobject to a different position on the canvas? I'm trying to move one of my UI gameobject to the position of another UI gameobject. I currently have this:
    Code (CSharp):
    1. myUIGameObject.transform.DOMove(myDestinationOnUI.transform.position, 1f)
    and with this code it goes to some unwanted area on the canvas.

    I've also tried:
    Code (CSharp):
    1. myUIGameObject.DOAnchorPos(myDestinationOnUI.GetComponent<RectTransform>().anchoredPosition, 1f)
    but this also seems to go to another unwanted area on the canvas.

    Hope to get some help and possibly some suggestions!
     
    Last edited: Feb 25, 2019
  3. indieDoroid

    indieDoroid

    Joined:
    Jan 25, 2016
    Posts:
    146
    Edit: Got it working.. I needed to add ONTOP of the original end position. Hope this helps others

    Code (CSharp):
    1. _rectTransform.DOAnchorPos(_endPos, 1).OnComplete(() => _rectTransform.DOAnchorPosY(_endPos.y + _yoyoHeight, 0.25f).SetLoops(-1, LoopType.Yoyo));


    Hi guys,
    Can anyone help with a problem I'm running into?

    I'd like to have a rect transform move to a certain position, then start to do a small looping "hop up and down".

    But what seems to happen is Dotween moves the rect transform to position, but then does a super big hop up and down.

    It seems to remember the starting position to calculate the "hop up and down" rather than the end position? That's my guess. Hope that makes sense.

    Please find the code snippet here. Any suggestions would be appreciated!

    Code (CSharp):
    1. _rectTransform.DOAnchorPos(_endPos, 1).OnComplete(() => _rectTransform.DOAnchorPosY(_yoyoHeight, 0.25f).SetLoops(-1, LoopType.Yoyo));
     
    Last edited: Feb 26, 2019
  4. indieDoroid

    indieDoroid

    Joined:
    Jan 25, 2016
    Posts:
    146

    Hey man,

    I had a similar idea. What I ended up doing was set up a vector 2 variable and use that value.
    So something like this. hope it helps.

    Code (CSharp):
    1. public vector2  _vec2 = new vector 2(0,1);
    2.  
    3. void Move()
    4. {
    5. _rectTransform.DOAnchorPos(_vec2, 1);
    6. }
     
    Tycellent likes this.
  5. ktest112233

    ktest112233

    Joined:
    Jan 7, 2019
    Posts:
    18
    Hi,
    Move on rigidbody2d runs in normal update or FixedUpdate?
     
  6. Fritsl

    Fritsl

    Joined:
    Mar 10, 2013
    Posts:
    179
    You set that yourself as far as I'm concerned:

    From website:
    SetUpdate(UpdateType updateType, bool isIndependentUpdate = false)
    Sets the type of update (Normal, Late or Fixed) for the tween and eventually tells it to ignore Unity's timeScale.
    updateType The UpdateType to use:
    UpdateType.Normal: Updates every frame during Update calls.
    UpdateType.Late: Updates every frame during LateUpdate calls.
    UpdateType.Fixed: Updates using FixedUpdate calls.
    UpdateType.Manual: Updates via manual DOTween.ManualUpdate calls.
    isIndependentUpdate If TRUE the tween will ignore Unity's Time.timeScale.
    NOTE: independentUpdate works also with UpdateType.Fixed but is not recommended in that case (because at timeScale 0 FixedUpdate won't run).
    transform.DOMoveX(4, 1).SetUpdate(UpdateType.Late, true);
     
  7. ExcellencyHong

    ExcellencyHong

    Joined:
    Aug 9, 2016
    Posts:
    16
    is there any constant values to branch by a status exist the Dotween or not?
    in complie time...

    like it ↓↓
    #if DOTWEEN
    ....
    #else
    ....
    #wndif
     
  8. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    406
    Hi, is there a way to emulate Sniper Scope hand-sways?
    In other words, the scope will move randomly from left/right, up/down.

    I thought the easiest way was to use, DoShakeRotation but with Vibrato 1, it moves too fast, and with Vibrato 0, it moves too slow.

    I'm using Duration 10 and with Vibrato 1 will shake many times. Shouldn't it vibrate just once regardless of the duration?

    If you have a better way to implement the scope hand-sways, please let me know.

    Thanks.

    Update: I tried to SetLoops(-1, LoopType.Restart) but it keeps repeating the same pattern instead of using Random I set in DoShakeRotation. Is this expected? It looks more like a bug.
     
    Last edited: Mar 7, 2019
  9. usernameHed

    usernameHed

    Joined:
    Apr 5, 2016
    Posts:
    37
    Hello, I have several Problematic with my path in DotWeen, could you help me ?

    1) Move an object myleft into the path, at constant speed.

    I would like to Move myself an object into a path (created from Dotween pro editor), with my own speed
    But I can't manage to find any MoveToPath(float speed) function to apply to my object...

    I have managed to find the function
    Code (CSharp):
    1. dotweenPath.GetTween().PathGetPoint(currentPercentage)
    .

    So now with an currentPercentage, I can gradually over time add to currentPercentage a speed value:
    Code (CSharp):
    1. currentPercentage = (currentPercentage  + (Time.deltaTime / 100) * currentSpeed) % 1;
    And like that I have a currentPercentage, always from 0 to 1 who increase. I have managed to move my object myself into the path.

    The problem: Now my speed is depending on the Lenght of the path. And this is a big problem. I would like to Move my object into the path with a constant speed...

    2) Find the closest point into the path, from a given Vector3 position

    I have an random point in the world. I would like, with this given point to find the closest point to the spline created by the dotWeen path.

    I don't want from you the algorithme to find the closest point (I can manage to calculate that), but I don't have the knowledge about the function & syntaxe I can use from DotWeen.
    I know with the DotweenPath, I can get all the PathWayPoint, but i would like to get the list of all the point (with a given resolution of course).

    3) From a given point in the spline of the path, How can I get the current Lenght ?

    Ok, so I have a point in the path. how can I have from a given point in the path, the actual Lenght covered, and Lenght remaining ?

    Thanks you !
     
    Last edited: Mar 11, 2019
  10. ginomartinalfonso

    ginomartinalfonso

    Joined:
    Apr 4, 2017
    Posts:
    1
    Hi I need help.
    I'm trying to stop this tween only
    Ex.
    DOTween.To (() => h_fill, x => h_fill = x, 1f, 0.75f).OnUpdate (H_FillUpdate1).OnComplete (H_FillUpdate1).SetDelay(0.5f);
     
  11. daniellllll

    daniellllll

    Joined:
    Sep 21, 2015
    Posts:
    2
    how to use dotext for contain emoji of string (it will crash now)
     
  12. SoulGameStudio

    SoulGameStudio

    Joined:
    Jan 18, 2016
    Posts:
    42
    @ginomartinalfonso Add to your tween:
    SetId("SomeId")
    then when you want to kill it
    DoTween.Kill("SomeId")
    (I recommend using const to avoid mistakes)
     
  13. Tycellent

    Tycellent

    Joined:
    Nov 7, 2014
    Posts:
    26
    What's the best way to make a UI gameobject follow a sprite that's using DOTween to move up/down? So my sprite moves up/down but i'd like the UI gameobject to be pretty much a "child" of the sprite in that it'll move up/down with the sprite.
     
  14. d4ni3lb

    d4ni3lb

    Joined:
    Mar 28, 2019
    Posts:
    1
    Hello! I'm working on a videogame project using DOTween v2.

    Ingame works fine but the "DOTWEEN SETUP REQUIRED" popup appear constantly.
    It appears when I open the project and can't close it. The only way is to enter to the DOTWEEN Unity Panel and close that window. That closes it for about 20 seconds until the window pops again.
    It appears everytime I enter play mode. How can I stop the window from appearing? I already get into settings and selected the Modules I need.
     
  15. Crouching-Tuna

    Crouching-Tuna

    Joined:
    Apr 4, 2014
    Posts:
    26
    Hi all. What really happens when i use SetSpeedBased with a SetEase not Linear?
    If my curve is like:
    [Time] : value
    [0] : 0
    [0.9] : 0.1
    [1.0] : 1
    Then yes, the tween moves super slow then jumps in speed, but over time. Where is the "time" set?

    If my curve is the opposite:
    [0] : 1
    [0.9] : 0.9
    [1.0] : 0
    Then the tween moves super fast, PAST the end point then stops, then after ~3seconds it goes back (really slowly) to the end point.

    How do i control the Ease, at least the time it goes along the curve, in SpeedBased?
    Cheers
     
  16. Nicholas1010

    Nicholas1010

    Joined:
    Aug 2, 2014
    Posts:
    20
    Hey.

    Quick question, I want to stop a tween once a condition is met.



    I see things like DOKill and stuff but I am not sure what to do lol, any quick tips?
     
  17. anil_unity385

    anil_unity385

    Joined:
    Feb 7, 2019
    Posts:
    15
    Hi there, I have a question.

    I have a Tween on a Text Object that moves up and fades out. It's used when the player doesn't have enough cash to buy something in my game. This works, but my issue is that I want the text to spawn from an object on a scroll rect, so it's position can change. I can get the object to change it's initial position, but I can't get it's Tween to change it's position. I am reusing the same object over and over instead of spawning a new one each time, and every time the player triggers the condition, I call DoRewind() and then DoPlay() on both the movement and fade tweens.

    What do I need to do in order to set the starting position of a Tween? Is it possible?
     
  18. Geads

    Geads

    Joined:
    Aug 24, 2017
    Posts:
    26
    The first time a DOTween action occurs it is very slow and kills framerate.

    DoTween.Component.Update()

    Is there a way to cache this or call something at the start so this doesn't happen?
     
    flipwon likes this.
  19. Gamrok

    Gamrok

    Joined:
    May 13, 2015
    Posts:
    11
    Since I updated my project to Unity 2019.1.0f2 (2018.2.14f1 before), some "DOFade(0, time)" don't longer work (no error is displayed in the console) while I have no problem with many others.

    I updated DOTween to the last version (1.2.235) but it doesn't solve the problem.

    Have you any idea?
     
    kurtbieg likes this.
  20. ben-rasooli

    ben-rasooli

    Joined:
    May 1, 2014
    Posts:
    21
    I'm using DOTween with unity 2019.1 and none of the RectTransform shortcut methods like DOSizeDelta are available. (I'm also using Assembly Definition Asset, in case it might be relevant to this issue)
     
  21. flipwon

    flipwon

    Joined:
    Dec 29, 2016
    Posts:
    76
    nvm
     
    Last edited: May 1, 2019
  22. spvn

    spvn

    Joined:
    Dec 10, 2013
    Posts:
    32
    Is there no way to tween to a moving transform? DoMove only accepts a Vector3. Unless I use ChangeEndValue but then in that case OnComplete doesn't get called because the tween keeps being rewinded. LeanTween seems to have this relatively simple feature and I'm disappointed that DoTween doesn't...
     
  23. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    61
    Update asseto to Unity 2019.1.1 PLEASE!
     
  24. sp-gillian

    sp-gillian

    Joined:
    May 8, 2019
    Posts:
    2
    Hi guys I'm wondering if you can help me. I'm having an issue where two tweens that should be of the same length are getting out of sync and it's driving me mad.

    Basically I have a move and a fade. The move has a duration of 2 seconds and a delay of 0.3 seconds. The fade has a duration of 2.3 seconds and no delay. At runtime they're in sync for about 2 loops, then start to get out of sync - how do I fix this?

    Code (CSharp):
    1. targetObj.transform.DOMove(endPosition, kMoveTime).SetDelay(kMoveDelay).SetLoops(kLoopMovement, LoopType.Restart).SetEase(Ease.InOutExpo);
    2.  
    3. targetImg.DOFade(1f, kMoveTime + kMoveDelay).SetLoops(kLoopMovement, LoopType.Restart).SetEase(_fadeCurve);
     
  25. sp-gillian

    sp-gillian

    Joined:
    May 8, 2019
    Posts:
    2
    Never mind. Sequences were what I wanted. New code (in case it helps anyone else):

    Code (CSharp):
    1. var seq = DOTween.Sequence();
    2.                 seq.SetLoops(kLoopMovement, LoopType.Restart);
    3.  
    4.                 var moveTween = targetObj.transform.DOMove(endPosition, kMoveTime).SetDelay(kMoveDelay).SetEase(Ease.InOutExpo);
    5.                 seq.Append(moveTween);
    6.                
    7.  
    8.                 var fadeTween = targetImg.DOFade(1f, kMoveTime + kMoveDelay).SetEase(_fadeCurve);
    9.                 seq.Insert(0f, fadeTween);
     
  26. 4ngryFace

    4ngryFace

    Joined:
    Jul 17, 2015
    Posts:
    11
    I'm using Unity 2019.1.2f1
    I imported Dotween Pro, before importing DoozyUI 3.
    https://assetstore.unity.com/packages/tools/gui/doozyui-complete-ui-management-system-138361

    On the DoozyUI Discord, they said that Dotween pro should work, despite the version difference between Pro and the free version.

    However, when I try to just build the project, for windows, I get the errors shown in the attached screenshot.

    I installed Dotween prior to DoozyUI, as Doozy directs.
    Doing a "Check Updates" from the DOTween Utility Panel verifies this as the latest version.
    Screenshot 2 of DOTween Utility Panel as installed.

    I've left preferences unchanged, but perhaps the "Safe Mode" should be disabled?
    Screenshot 3.

    TextMesh Pro was installed prior to both DOTween Pro, and DoozyUI 3.
    Version 2.0.0, verified for 2019.1, though there is a preview version 2.0.1.
    Dotween Utility Panel has everything under "Unity" enabled, and TextMesh Pro enabled.
    Screenshot 4.

    This is a 3d project, so I may need to disable Physics2d? Or is that irrelevant.
    The errors don't appear to be related though, as basic functionality such as CustomEditor portions of DOTween code are throwing an error, as seen in screenshot 1.

    Any advice or solution? Do I need to use the free version?
    If so, has Pro been deprecated for use in 2019.1?
     

    Attached Files:

  27. andersTheNinja

    andersTheNinja

    Joined:
    May 17, 2018
    Posts:
    4
    Hi, I'm getting build errors when building for macOS and iOS. Haven't tested any other platforms.
    I created new, empty projects using 2018.3.14, 2019.1.1 and 2019.1.2. Added the DOTween Pro package from asset store, ran the DOTween setup with all components except External/2D toolkit & created asmdef, then tried doing a build. Did not create anything in scene.
    Same error in all 3 cases, both for macOS platform and iOS.

    Errors seem to suggest that editor components are being referenced in player builds. I tried deleting the Assets/Demigiant/DotweenPRO/Editor directory, and then the build worked.

    there are no errors in console, and play mode works fine.

    Any ideas? Am I doing something wrong?

    Editor log attached. Log Excerpt:
    "Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs"
    "Assets/Demigiant/DOTweenPro/DOTweenProShortcuts.cs"
    "Assets/Demigiant/DOTweenPro/DOTweenTextMeshPro.cs"
    "Assets/Demigiant/DOTweenPro/DOTweenTk2d.cs"
    "Assets/Demigiant/DOTweenPro/Editor/DOTweenAnimationInspector.cs"
    "Assets/Demigiant/DOTweenPro/Editor/DOTweenPreviewManager.cs"

    -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/DOTweenPro.Scripts.dll
    Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
    Copyright (C) Microsoft Corporation. All rights reserved.

    Assets/Demigiant/DOTweenPro/Editor/DOTweenAnimationInspector.cs(7,10): error CS0234: The type or namespace name 'DemiEditor' does not exist in the namespace 'DG' (are you missing an assembly reference?)
    Assets/Demigiant/DOTweenPro/Editor/DOTweenAnimationInspector.cs(8,24): error CS0234: The type or namespace name 'Core' does not exist in the namespace 'DG.DOTweenEditor' (are you missing an assembly reference?)
    Assets/Demigiant/DOTweenPro/Editor/DOTweenAnimationInspector.cs(9,24): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'DG.DOTweenEditor' (are you missing an assembly reference?)
    Assets/Demigiant/DOTweenPro/Editor/DOTweenPreviewManager.cs(6,10): error CS0234: The type or namespace name 'DemiEditor' does not exist in the namespace 'DG' (are you missing an assembly reference?)
    Assets/Demigiant/DOTweenPro/Editor/DOTweenPreviewManager.cs(11,7): error CS0246: The type or namespace name 'UnityEditorInternal' could not be found (are you missing a using directive or an assembly reference?)
    Assets/Demigiant/DOTweenPro/Editor/DOTweenPreviewManager.cs(112,44): error CS0246: The type or namespace name 'PlayModeStateChange' could not be found (are you missing a using directive or an assembly reference?)
    Assets/Demigiant/DOTweenPro/Editor/DOTweenAnimationInspector.cs(25,46): error CS0246: The type or namespace name 'ABSAnimationInspector' could not be found (are you missing a using directive or an assembly reference?)
    Assets/Demigiant/DOTweenPro/Editor/DOTweenAnimationInspector.cs(726,6): error CS0246: The type or namespace name 'InitializeOnLoadAttribute' could not be found (are you missing a using directive or an assembly reference?)
    Assets/Demigiant/DOTweenPro/Editor/DOTweenAnimationInspector.cs(726,6): error CS0246: The type or namespace name 'InitializeOnLoad' could not be found (are you missing a using directive or an assembly reference?)
    Assets/Demigiant/DOTweenPro/Editor/DOTweenAnimationInspector.cs(24,6): error CS0246: The type or namespace name 'CustomEditorAttribute' could not be found (are you missing a using directive or an assembly reference?)
    Assets/Demigiant/DOTweenPro/Editor/DOTweenAnimationInspector.cs(24,6): error CS0246: The type or namespace name 'CustomEditor' could not be found (are you missing a using directive or an assembly reference?)
    Assets/Demigiant/DOTweenPro/Editor/DOTweenAnimationInspector.cs(208,30): error CS0115: 'DOTweenAnimationInspector.OnInspectorGUI()': no suitable method found to override
    -----CompilerOutput:-stderr----------
    -----EndCompilerOutput---------------
    - Finished compile Library/ScriptAssemblies/DOTweenPro.Scripts.dll
     

    Attached Files:

  28. andersTheNinja

    andersTheNinja

    Joined:
    May 17, 2018
    Posts:
    4
    @4ngryFace Seems we hit the same thing, just moments apart. Was also trying to use it with Doozy, but stumbled upon this. Tried creating blank projects with only DOTween just to rule out other components.

    Deleting Assets/Demigiant/DOTweenPro/Editor folder seems to remove build errors in my case at least. Don't know if there are any side effects, since I'm completely new to DOTween..
     
  29. 4ngryFace

    4ngryFace

    Joined:
    Jul 17, 2015
    Posts:
    11
    Looks identical to what i'm getting @andersTheNinja , hopefully we'll get an answer shortly.

    I'm also completely new to working with DoozyUI and though I've had DOTween Pro for a couple years, I haven't worked with it until now.

    It seems like it isn't getting the right Using arguments, but they are there (see screeshot).
    using unityEditor clearly listed in the same script.
     

    Attached Files:

  30. andersTheNinja

    andersTheNinja

    Joined:
    May 17, 2018
    Posts:
    4
    @4ngryFace If I understand correctly any Editor components and the UnityEditor namespace should never be included in a build. For some reason the Editor components for DOTween are being included in the build, but can't compile since UnityEditor namespace is not available when building player.

    For me the workaround to remove the /editor folder seems to work. I don't really need any pro features for now, so it's not a burning issue but let's hope someone takes a look!
     
  31. 4ngryFace

    4ngryFace

    Joined:
    Jul 17, 2015
    Posts:
    11
    Gotcha, that would make sense.

    Thanks for sharing.
     
  32. 4ngryFace

    4ngryFace

    Joined:
    Jul 17, 2015
    Posts:
    11
  33. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,227
    @4ngryFace @andersTheNinja I think it might be a problem with ASMDEF and Unity 2019 (and in some cases latest version of 2018.3), which have changed their behaviour and now don't distinguish between editor and non-editor code. Can you try to install the updated version I just uploaded here? Just overwrite your DOTween folder with the one inside the ZIP. After that, you will be asked to run the Setup again. Do it, then from the Utility Panel remove the ASMDEF and recreate them: the new system creates an extra one for editor code to force the separation.
     
  34. 4ngryFace

    4ngryFace

    Joined:
    Jul 17, 2015
    Posts:
    11
    @Izitmee If I delete the folder (assets>Demigiant>DOTween), and replace it w/ unity not open, it did not prompt the setup and the Unity "Tools" gets broken (all I have is Doozy and Demigiant) other than "Version".

    But if I have Unity Open, remove Demigiant folder entirely, re-import DOTween Pro, the Setup window appears. I then ignored it while I deleted the Demigiant>DOTween folder from the Asset Store, and replace with the new version you have provided on your website.

    Then I use the Setup, settings appear to be as they were prior (TextMeshPro enabled as I had selected), and built the ASMDEF.

    Build then works.

    The new folder appears to correct the error.

    Now, I'm wondering if I should re-import Doozy as it explicitly required DOTween installed prior.
    I'm not sure if this process would have messed anything up on that front.

    Thanks!
     
  35. 4ngryFace

    4ngryFace

    Joined:
    Jul 17, 2015
    Posts:
    11
    @andersTheNinja Dev has solution uploaded to their website, see posts above.
     
  36. Tycellent

    Tycellent

    Joined:
    Nov 7, 2014
    Posts:
    26
    What are some of the ways to kill a tween? I'm currently struggling to find what is killing my tween before it completes its path but can't seem to find the reason why it's being killed prematurely.
     
  37. luniac

    luniac

    Joined:
    Jan 12, 2011
    Posts:
    492
    Can you provide a more in depth sequence example?
    The documentation code is cut off as well.

    Do the default setting AutoKill apply to sequences?

    I'm trying to create a sequence of timers.
    is it like this:
    Code (CSharp):
    1. Sequence s = DOTween.Sequence();
    2. s.AppendInterval(timer0).AppendCallback(callback0);
    3. s.AppendInterval(timer1).AppendCallback(callback1);
    4. s.AppendInterval(timer2).AppendCallback(callback2);
    5. s.SetAutoKill(false);
    In default settings i set Autoplay for sequences to FALSE.

    so if i want to play the sequence at any time i just call
    Code (CSharp):
    1. s.Play();
    To stop without callback
    Code (CSharp):
    1. s.Complete(false);
    and that's it right?
    thanks.


    One final question
    Is there any reason to not auto recycle? is there risk of something?
     
    Tycellent likes this.
  38. Tycellent

    Tycellent

    Joined:
    Nov 7, 2014
    Posts:
    26
    I was not aware of this setautokill. i'll definitely look into it. Thanks!
     
  39. luniac

    luniac

    Joined:
    Jan 12, 2011
    Posts:
    492
    lol glad i helped, even if indirectly.
     
  40. luniac

    luniac

    Joined:
    Jan 12, 2011
    Posts:
    492
    ok i tested it all out myself lol, seems to work.
     
  41. kurtbieg

    kurtbieg

    Joined:
    Oct 2, 2013
    Posts:
    9
    hey i am on unity 2019.1.1 and i am trying to dotween fade a sprite in the UI but it doesn't seem to appear? I can see via editor that the alpha is changing but on screen it doesn't seem to change at all. if i manually change the alpha via editor i can see the effect but when i trigger via dotween the effect is not visible. I also got the latest dotween from asset store. thanks

    update i got v1.2.245 and the problem still persists

    update: ok i figured out what's wrong.
    i change the sprite via image.sprite = newsprite and that didn't seem to work (it worked previously).
    i use image.overrideSprite = newsprite and now it works fine
     
    Last edited: May 15, 2019
  42. flipwon

    flipwon

    Joined:
    Dec 29, 2016
    Posts:
    76
    I'm also interested in this as this effect is more pronounced on mobile.
     
  43. ilyaskos3

    ilyaskos3

    Joined:
    Apr 25, 2019
    Posts:
    1
    i want to my missile follow path and its head is always on the path.
    here is my code
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using DG.Tweening;
    5.  
    6. public class testfirework : MonoBehaviour
    7. {
    8.     [SerializeField] private GameObject fireWork;
    9.  
    10.     public Ease ease = Ease.Linear;
    11.     public AxisConstraint lockPosition;
    12.     public AxisConstraint lockRotation0, lockRotation1;
    13.     public LoopType loopType = LoopType.Yoyo;
    14.     public PathMode pathMode;
    15.     public int pathResolution = 10;
    16.     public bool closePaths;
    17.     public Vector3 forward = Vector3.forward;
    18.     public Vector3 up = Vector3.up;
    19.     public float lookAhead = 0;
    20.     public PathType pathType;
    21.     public float duration;
    22.  
    23.     Tween controller;
    24.  
    25.     void Start()
    26.     {
    27.         Move();
    28.  
    29.     }
    30.  
    31.     void Move()
    32.     {
    33.         Vector3[] path = new[] {
    34.             new Vector3(-2f,-2f,0),
    35.             new Vector3(+2f,+2f,0),
    36.             new Vector3(+2,-2,0),
    37.             new Vector3(-2f,+2f,0),
    38.         };
    39.      
    40.         GameObject trail = Instantiate(fireWork, new Vector3(-2,-2,0), Quaternion.identity);
    41.  
    42.         AxisConstraint lockRotation = lockRotation0 | lockRotation1;
    43.      
    44.         TweenParams tp = new TweenParams()
    45.             .SetEase(ease)
    46.             .SetLoops(-1, loopType);
    47.  
    48.         trail.transform.DOPath(path, duration, pathType, pathMode, pathResolution)
    49.             .SetOptions(closePaths, lockPosition, lockRotation)
    50.             .SetLookAt(lookAhead, forward, up)
    51.             .SetAs(tp);
    52.     }
    53. }
    result :


    how do i rotate its head while following the path ?
    my asset :
     
    Last edited: May 29, 2019
  44. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    451
    Hi,

    I've spent the whole day trying to fix this issue, but not sure if the problems on DOTween Pro end or 2D Toolkit.

    I have opened up a project I haven't touched in a year to do some upgrades to it. Because it'd been a while, I uninstalled 2D Toolkit and DOTween Pro from the project completely, and then reinstalled the latest 2D Toolkit and then the latest DOTween Pro and followed the instructions to upgrade.

    I've done this countless times now all day but am still getting the following errors:

    (Won't post all 15 of them)

    Assets/Demigiant/DOTweenPro/DOTweenTk2d.cs(24,81): error CS0246: The type or namespace name 'tk2dBaseSprite' could not be found (are you missing a using directive or an assembly reference?)

    Assets/Demigiant/DOTweenPro/DOTweenTk2d.cs(154,82): error CS0246: The type or namespace name 'tk2dTextMesh' could not be found (are you missing a using directive or an assembly reference?)

    Assets/Demigiant/DOTweenPro/DOTweenTk2d.cs(111,91): error CS0246: The type or namespace name 'tk2dSlicedSprite' could not be found (are you missing a using directive or an assembly reference?)

    I have ticked the 2D Toolkit module in the Dotween Setup utility. Not sure what else to do. I've got the lastest DOTween. I'm running DOTween Pro 1.0.145 and Dotween 1.2.2.45.

    These are running fine on another project.

    REALLY hoping someone can help, as I've wasted 6 hours trying to resolve this.
     
  45. dantipov

    dantipov

    Joined:
    Oct 4, 2018
    Posts:
    1
    Hi,
    Is anybody knows if DOTween will be upgraded with C# Jobs System?
     
  46. Tycellent

    Tycellent

    Joined:
    Nov 7, 2014
    Posts:
    26
    I'm currently having trouble with the OnWaypointChange() callback. My DoPath has 4 total waypoints but at the start of my DOPath it seems like the first 2 waypoints are triggered even though the points aren't even close to each other. It's as if the first 2 waypoints are right next to each other but i've checked the array's points and it states that they're far away from each other. I even put in in-game markers to see where these points are and from these markers it shows that these 2 first points are far away from each other. So i'm not sure why they're both being triggered.

    The really weird thing is that when this DoPath starts over again (when the gameobject returns to waypoint 0) the waypoints work as intended in that they are triggered correctly and the first 2 aren't "next to each other". I checked the positions of each waypoints and they're all correct at all times but it's just this first DoPath course that waypoint 0 and waypoint 1 are triggered almost at the same time (waypoint 1 is triggered almost immediately after waypoint 0, but not at the same time) even though these 2 waypoints aren't even close to each other.

    In fact, the first "lap" almost all the waypoints seem to be triggered at incorrect positions even though the points in the arrays remain the same at all time. The laps after the first lap seems to be all fine :eek:

    Hope to get some possible suggestions for this.

    EDIT: I removed the waypoint 0 (which was the position of where the player is and shifted the indexes up. Seems to have solved the problem. Not 100% sure why but it works as intended now
     
    Last edited: Jun 4, 2019
  47. MarkHenryC

    MarkHenryC

    Joined:
    Nov 30, 2009
    Posts:
    63
    Hi. Maybe this is an Asset Store question, but I'll try here. On 27 July 2017 I purchased dotween as part of a package. It's in my purchase history but it's not in my Asset Store purchase list. In the Asset Store listing, there's an Update button but a price above it. Do I have to re-purchase a later version?

    UPDATE: looks like an Asset Store problem, as I'm getting it with other purchased products.
     
    Last edited: Jun 7, 2019
  48. helloworldgames

    helloworldgames

    Joined:
    Mar 16, 2017
    Posts:
    59
    Hi there,

    How can i DoRotate so it keep rotating endless without stoppping or delays. I tried following but failed

    InputGlobe.DOLocalRotate(new Vector3(0, 0, 360), 1, RotateMode.FastBeyond360).SetLoops(9999, LoopType.Incremental);
     
  49. rodrigozol

    rodrigozol

    Joined:
    Apr 4, 2009
    Posts:
    22
    I can't figure what is missing to try the examples. I can't find "ABSTweenPlugin" in any folder.
    Tks fot any help.

    Assets\DOTween Examples\CustomPlugin Example\CustomRangePlugin.cs(14,14): error CS0534: 'CustomRangePlugin' does not implement inherited abstract member 'ABSTweenPlugin<CustomRange, CustomRange, NoOptions>.SetFrom(TweenerCore<CustomRange, CustomRange, NoOptions>, CustomRange, bool)'


    upload_2019-6-9_12-12-18.png
     
  50. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    351
    You can set loops to -1 for infinite looping. Try using LocalAxisAdd as the rotate mode. And if the default easing is not set to linear, you may want to set that, if you want a continuous uninterrupted rotation.

    Code (CSharp):
    1. InputGlobe.DOLocalRotate(new Vector3(0, 0, 360), 1, RotateMode.LocalAxisAdd).SetLoops(-1, LoopType.Incremental).SetEase(Ease.Linear);
     
    helloworldgames likes this.