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. nilsk123

    nilsk123

    Joined:
    Dec 13, 2016
    Posts:
    19
    First off, thanks for providing this engine for free. I'm developing my first game in unity and its saving me loads of time.

    I was wondering if theres a way to synchronise the exact start time of a sequence. My usecase is that a number of enemies first move towards a waypoint, and when they have arrived there they should all start the same sequence at the exact same time. I have some ideas about implementing this, but I was wondering if theres a function for this in the SDK, as i couldnt find it in the documentation.
     
  2. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,227
    Hi @nilsk123 ,

    I'm not sure of what you mean. If you start all the Sequences of all your enemies in the same frame, they will all start at the same time. Unless you mean if there's a built-in method to wait for all your enemies to reach a given state, in which case sorry but no, there isn't :p
     
  3. baturalp_gurdin_dotto

    baturalp_gurdin_dotto

    Joined:
    Jan 18, 2017
    Posts:
    1
    Hello, I've faced with some problem if anyone can help I really appreciate. I am currently using DOMoveY to drop my object with out bounce ease type. I want to make some kind a jelly drop animation with just changing scale values on each bounce but I could not find anything in documentation related with ease steps.
     
  4. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    I am noticing a trend, guys.
    Dotween is a tweening library, a really amazing one, but it doesnt have built in absolutely every single possible case you can think of. It is generic enough that you can use it however you please but you have to use your imagination on how can a tween apply to your problem.

    @nilsk123 You could use a single tween for that, define your lerping for each of your enemies and use a generic tween that will go from 0 to 1, using this value to set the current position of your enemies, once the tween arrives at 0, make a callback on complete to start your sequence, from the same source. If your enemies should not all arrive at the same time, use modifiers in your values when lerping (like the enemies that should arrive first could use the value from the tween multiplied by a bigger number and limit it to 1 if bigger than 1)

    @baturalp_gurdin_dotto You dont even need a tween for that, using your current position vs your previous position you can determine a "squish" and apply said squish to your scale, you can record multiple frames of positions for even more interesting results.

    Hope it helps.
     
    FuguFirecracker and Izitmee like this.
  5. romandutov

    romandutov

    Joined:
    Sep 18, 2015
    Posts:
    13
    Hello!
    I'm trying add tweener behavior programatically:

    Code (CSharp):
    1.  
    2.  var inAnim = new GameObject("In", typeof(RectTransform));
    3. //..some code
    4. var newAnimTween = inAnim.AddComponent<DOTweenAnimation>();
    5.  
    6.             newAnimTween.animationType = DOTweenAnimationType.Move;
    7.             newAnimTween.autoPlay = true;
    8.             newAnimTween.autoKill = false;
    9.  
    10.             newAnimTween.isIndependentUpdate = true;
    11.             newAnimTween.duration = 0f;
    12.            
    13.  
    14.             newAnimTween.hasOnPlay = true;
    15.             newAnimTween.onPlay = new UnityEvent();
    16.             newAnimTween.onPlay.AddListener(() =>
    17.             {
    18.                 print("Play");
    19.  
    20.                 for (var i = 0; i < animatedObj.Length; i++)
    21.                 {
    22.                     animatedObj[i].SetActive(true);
    23.                     animatedObj[i].GetComponent<DOTweenAnimation>().DORestartAllById(idAnimationIN);
    24.                 }
    25.             });
    But event listnter doesn't fired. I see adding my component in inspector, animation type, hasOnPlay and other property work well. Tell me please, what am I doing wrong? Thanks in advance.
     
    su9257 and io-games like this.
  6. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,227
    @romandutov Ahoy!

    You don't use a DOTweenAnimation to create a tween at runtime, since that's only used for visual scripting in the editor. Instead, you should directly create a Tween/Tweener/Sequence (which is much more easy by the way ;)).
     
    su9257 likes this.
  7. romandutov

    romandutov

    Joined:
    Sep 18, 2015
    Posts:
    13
    @Izitmee That's not runtime, just creating tween from editor script. I would like to simply fill in the required fields that are all work in the runtime
     
  8. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,189
    I was wondering what the best way would be to use dotween for artists on a controller component - maybe with unity events or something so artists can chain events one after the other etc....

    Rotate this platform, move it, call a function and so on...

    Is this a good or bad fit for that kind of idea?
     
  9. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,227
    @hippocoder You mean having pre-determined tweens that artists can chain together while being also able to choose things like ease and duration? Are you thinking of a per-gameObject component or a global one? For a per-gameObject, an interesting idea might be to have a series of draggable list elements, each one containing the tween settings, with a header that allows to choose if the tween should be chained, appended, or appended with a delay. Then at runtime you could create a Sequence out of that data.

    @romandutov Ah I understand now! Then the problem is that you're assigning an anonymous function to a UnityEvent, and that can't be serialized. Instead, you need to assign an existing public method on the MonoBehaviour (as far as I know: I didn't really try). Let me know if that works, and if that doesn't, I'll try to make some test this evening.
     
  10. romandutov

    romandutov

    Joined:
    Sep 18, 2015
    Posts:
    13
    @Izitmee
    I do so, like works:

    Code (CSharp):
    1.  
    2. public void EditorCallbackTest(){
    3. //...
    4. newAnimTween.hasOnPlay = true;
    5.             newAnimTween.hasOnRewind = true;
    6.  
    7. #if UNITY_EDITOR
    8.             newAnimTween.onPlay = new UnityEvent();
    9.             UnityEditor.Events.UnityEventTools.AddPersistentListener(newAnimTween.onPlay, new UnityAction((OnPlayIn)));
    10.          
    11. #endif
    12. //...
    13. }
    14.  
    15. public void OnPlayIn()
    16. {
    17.      for (int i = 0; i < animatedObj.Length; i++)
    18.      {
    19.             animatedObj[i].SetActive(true);
    20.             animatedObj[i].GetComponent<DOTweenAnimation>().DORestartAllById(idAnimationIN);
    21.       }
    22. }
    Perhaps there is a better way =) I would like to see in the list, complete list of callbacks, and not a single reference to a script (for helpful the artists)
     
  11. TheADrain

    TheADrain

    Joined:
    Nov 16, 2016
    Posts:
    48
    Hi Izitmee,

    I've found DOTween indispensable lately, really the AppendCallback function alone has saved me huge chunks of time.

    But I'm using it at the moment for the DOTween visual path editor and I need paths that are reversible and give me a reliable callback when hitting either end, unfortunately I'm having a few issues.

    If I want to play a path in reverse from end to beginning, if I use GoTo or DoComplete beforehand to ensure the path is at the end, it fires the OnComplete function right away, which i'd expect from DoComplete so I could work around that by ignoring it if we're playing in reverse and then picking up the OnRewind function via DoPlayBackwards instead.

    Only problem is I can't get OnRewind to fire at all whether I DoRewind, DoRewindSmooth or DoPlayBackwards it never seems to fire.

    Any advice you could offer on this?
    Cheers.
     
  12. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,227
    @TheADrain Damn, I'm really sorry, I made some check and you're right. I added OnRewind on the last update because of a user request, but I implemented it only in DOTweenAnimation. Fixed it: grab the latest version from the private download area (v0.9.660), and please let me know if everything's right on your side too after that (if you don't have access to the download area, here's how to get it).

    @romandutov Glad you got it working :) But I didn't really understand your last sentence, could you explain me more?
     
  13. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    509
    I got a bug....

    Dotween Pro v0.9.650

    Goal:
    Using Move to bring an object from outside the view into the view smoothly.

    Problem:
    Leaving Auto-Play and Auto-Kill off will cause it to auto-start the Tween when I enter play mode and it doesn't behave as expected because it moves to the wrong position too.

    Setting it to Auto-Play whether Auto-Kill is on or off will fix it to expected and correct behavior.
    In my case Auto-Kill must be turned off otherwise RestartById will fail. Auto-Play should be off as well as I would like to trigger the Move Tween when I want it to through another game object.
     
    Last edited: Feb 18, 2017
  14. TheADrain

    TheADrain

    Joined:
    Nov 16, 2016
    Posts:
    48
    Oh wow that's awesome, thank you! I really appreciate this. I wasn't aware it was such a recent addition.

    I'd found a workaround by using OnStep instead of OnRewind and OnComplete, but a fix is awesome. Thanks.
     
  15. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    331
    Hi there

    I am moving and rotating a rigidbody2d using:
    Code (CSharp):
    1. rg.DOMove(SceneSelector.sceneSelectorPosition, 0.5f);
    2. transform.DORotate(ANGLE, 0.5f, RotateMode.Fast).OnComplete(MakeSceneIconStill);
    I tried using rg.DORotate(FLOAT_ANGLE, 0.5f) but it doesn't quite work the same way.

    The idea is to apply rotation to the rigidbody2d instead of using the transform but I like the results from transform.DORotate rather than rg.DORotate
    Do you have an alternative to this?

    Thanks
     
    Last edited: Feb 19, 2017
  16. PixelizedPlayer

    PixelizedPlayer

    Joined:
    Feb 27, 2013
    Posts:
    356
    So how do i create a tween, assign it to a variable but not have it run ? I want to make it run by code, as well have some identifiable way to cancel any currently running tween by some ID. The documentation doesn't explain any of these things at least no where that i have seen.

    This is what i tried:


    Code (CSharp):
    1. Tweener tween;
    2.  
    3.  
    4. void ChangeState()
    5. {
    6.     tween.Kill(); // not working
    7.     if (state)
    8.     {
    9.         tween = rectTransform.DOAnchorPos(upPosition, 1.75f, false); // don't want it to auto-run
    10.     }
    11.     else
    12.     {
    13.         tween = rectTransform.DOAnchorPos(downPosition, 1.75f, false);
    14.     }
    15.     state = !state;
    16. }
     
  17. BNocentini

    BNocentini

    Joined:
    Jun 24, 2015
    Posts:
    1
    Hi,

    I am somewhat new to DOTween and have been trying to migrate from Unity's animation system to this one.
    I have a simple animation sequence that I want to have in my game, it goes as follows:
    Code (CSharp):
    1. m_MoveLeft = DOTween.Sequence();
    2.         m_MoveLeft.Insert(0.0f, m_PlayerModel.DOScale(new Vector3(1.25f, 0.8f, 1.0f), 0.05f));
    3.         m_MoveLeft.Insert(0.05f, m_PlayerModel.DOScale(new Vector3(1.0f, 1.0f, 1.0f), 0.2f));
    4.  
    5.         Vector3[] _path = new Vector3[5];
    6.         _path[0] = new Vector3(0.0f, 0.0f, 0.0f);
    7.         _path[1] = new Vector3(-.5f, 0.35f, 0.0f);
    8.         _path[2] = new Vector3(-1.0f, 0.55f, 0.0f);
    9.         _path[3] = new Vector3(-1.5f, 0.35f, 0.0f);
    10.         _path[4] = new Vector3(-2.0f, 0.0f, 0.0f);
    11.  
    12.         m_MoveLeft.Insert(0.0f, m_PlayerModel.DOPath(_path, 0.5f, PathType.CatmullRom, PathMode.Ignore).SetRelative().SetEase(Ease.Linear));
    This works fine if I play it once. But once the animation is done the player is in a different spot and if I try to move left again the sequence restarts from the original position and not the new position. Through research I found out a sequence is like a movie and therefore, static in nature. The points won't change once they are set. And that's exactly the opposite of what I am trying to do.

    Now to the questions.
    Is there a way to do what I want using sequences? Having changing start and end positions to them?
    If not, how can I accomplish something similar with a Tweener? Should I be chaining callbacks after each tween is done? That does not seem correct at all to me.

    Anyway, thanks for taking the time!
     
  18. Anemor2000

    Anemor2000

    Joined:
    Jun 12, 2015
    Posts:
    35
    For some reason, dotween pro requires 2dtoolkit or it has missing reference. We used to use it but we removed it long before we installed dotween. How does dotween detects if its installed or not, Id like to make a clean install without it. Thanks
     
  19. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    69
    Where does DoTween save its settings after pressing "Setup DoTween..."?

    When I share my project with a colleague, he gets weird null reference errors, which get fixed only after he does "Setup DoTween..." on his side. That's a pretty weird behavior, and it took me half a day to find the issue.

    [Edit] If I delete and re-download the project, I have no issues on my side - I don't need to "Setup DoTween..." again.
     
  20. euphere

    euphere

    Joined:
    May 5, 2014
    Posts:
    23
    Hi @Izitmee !

    Thank you for your replay. Setting time scale to some very high value worked for me.
     
  21. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    472
    @Izitmee

    When I do this:
    Code (CSharp):
    1. for (int i = 0; i < linePoints.Count-1; i++) {
    2.             DOTween.To (() => linePoints [i], x => linePoints [i] = x, Vector3.zero, elastoTime).SetEase (easeType);
    3.         }
    It only tweens the last item. linePoints is a Vector3 List and I want to tween them all at the same time. Any suggestions?

    Edit: Nevermind I've found a workaround...
     
    Last edited: Feb 27, 2017
  22. yanjingzhaisun

    yanjingzhaisun

    Joined:
    Jun 30, 2013
    Posts:
    8
    Hi Thread.

    There is one problem that I'm stuck with. The situation is:

    I've already used DOTween a lot in my project. Today I integrated wwise and C# 6.0 support, and for some reason it re-compiles everything in the project. Then the problem emerges: My scripts can't find namespace DG anymore. The awkward thing is, since a lot of the scripts can't find DG namespace, the editor crashes so that there is no "tool" section in Unity window, makes it impossible to use utility panel to reinstall DOTween to fix these problems.

    How should I fix this issue?
     
  23. bzor

    bzor

    Joined:
    May 28, 2013
    Posts:
    31
    just started using DOTween and we're finding it really suits our needs, way better than the other packages we've evaluated.. thanks!

    question, is there a way for a tween added to a sequence to not effect the current time within the sequence? for example:

    Code (csharp):
    1.  
    2. Sequence mySequence = DOTween.Sequence();
    3. mySequence.Append(transform1.DOMoveX(5f, 1f));       //happens at start
    4. mySequence.Append(transform1.DOMoveX(10f, 1f));     //happens at 1s
    5. mySequence.Join(transform2.DOMoveX(10f, 10f));         //happens at 1s, should not affect "playhead"
    6. mySequence.Append(transform1.DOMoveX(15f, 1f));     //want this to happen at 2s, not 11s
    7.  
    it looks like Insert does this, but then I'd need to calculate the atPosition myself which could get tedious with long sequences. I want it to start at the same time it would with Join or Append, but have it's duration not affect the playhead. make sense?
     
  24. the_schmoey

    the_schmoey

    Joined:
    Nov 22, 2016
    Posts:
    4
    Yo Dotween'ers.

    I'm absolutely failing to do something that is probably incredible simple, and hereby admit defeat. Please help.

    If I play a sequence, I want to get the individually playing tween out of that sequence, or the current transform target of the currently playing tween, or just something that doesn't return the sequence. Can a sequence be broken down to its parts, or am I flying to close to the sun?

    Thanks smarter people than me.
     
  25. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    69
    You can assign a callback to any tweener from the sequence tween.onUpdate( callback );
     
  26. Shnayzr

    Shnayzr

    Joined:
    Aug 31, 2014
    Posts:
    17
    Great asset!

    I am playing with it now but I have a question:

    Can I use Dotween to increase an int from x=0 to x=10 in 5 seconds for example? or string str=a to str=z in a period of time?
     
  27. FuguFirecracker

    FuguFirecracker

    Joined:
    Sep 20, 2011
    Posts:
    240
    Yes, yes you can.
    RTFM
     
  28. brett_ridel

    brett_ridel

    Joined:
    Jan 15, 2017
    Posts:
    31
    Hi all

    I'm just trying this new tool (for me at least), and it seems amazing.
    However, I have some questions. If this can help, I use it to move the player area in a VR game (SteamVR).

    First, I would like to know if there is a good way to get back (in a script) the current velocity of the moving object ? I tried to compute it myself (currentPos - oldPos)/deltaTime), but it's not perfect at all because there are some noisy values !?

    For my second question, I use the InOutQuad ease, but it seems that the increase of speed/velocity is a little bit broken. I explain myself : at first, the velocity increases, then it stagnates/slows down, then increases again, then stagnates/slows down, ... until it reachs the max speed : It's not perfectly smooth. I tried several different options, but the problem still occurs (except for the linear ease). Edit : this problem seems to occur with Catmull Rom path (no matter the path resolution) and not with the linear one.

    I hope you can help me.
    Brett
     
    Last edited: Mar 28, 2017
  29. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    249
    Hi @Izitmee! Last time I was here this thread only had 20 pages. I see you've been busy! :D :p (Good job!)

    Hopefully a quick question:

    [TL;DR: I want to run a full sequence backwards instantly (including callbacks)! ;)]

    We have a DOTween sequence for sliding open a menu. We apply the animation in both directions (to open and close the menu), so we happily use PlayForward and PlayBackwards.

    The sequence starts with an AppendCallback for disabling/enabling objects and changing a few parents, and then has several Joins to animate a few tweens together.

    Thing is, in certain cases we want the Sequence to instantly snap to the start or to the end, so we use Rewind or Complete, respectively. The problem is that Rewind doesn't seem to trigger the callbacks (maybe because rewind should probably be used to "reset" the sequence, not to "run it in reverse instantly"). Complete also doesn't work on a Backwards tween, as it sends it to the "forward" end.

    Is there an easy way to complete a sequence/tween backwards? (i.e. that also calls all callbacks)

    Thanks! :)
     
    Last edited: Mar 31, 2017
  30. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,227
    Ahoy @CanisLupus!
    Rewind doesn't call callbacks in your case, because callbacks are called only if something is actually rewinded. I use DOTween with menus like you often, but I recommend an additional step. As you're doing, let DOTween deactivate elements on rewind, and activate them on play, but as an additional step also deactivate them manually the first time.
    On a secondary note, this makes me think that I could also make the callbacks public, so you could just call onRewind manually :p Let me think about it. And on a third-ish (I don't know how to say that) note, you can complete a sequence, set its timeScale to some very high number, and use PlayForward to play it backwards very quickly.

    Cheers,
    Daniele
     
  31. CulzeanHexWar

    CulzeanHexWar

    Joined:
    Sep 18, 2015
    Posts:
    7
    I have just upgraded to Unity 5.6 and am finding a bug when attempting to build to iOS using IL2CPP. This takes place during bytecode stripping and happens even if I remove strip engine bytecode flag. It does seem to be caused by DOTween I'm afraid. I am using DOTween v1.1.555 and DOTweenPro v0.9.470. Will there be a patch soon for this?

    Failed running /Applications/Unity/Unity.app/Contents/Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe --api NET_2_0_Subset -out "/Users/danielwaine/Desktop/HexWar/root/Temp/StagingArea/Data/Managed/tempStrip" -l none -c link -b true -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Core.xml" -f "/Applications/Unity/Unity.app/Contents/il2cpp/LinkerDescriptors" -x "/Users/danielwaine/Desktop/HexWar/root/Temp/StagingArea/Data/Managed/../platform_native_link.xml" -x "/Users/danielwaine/Desktop/HexWar/root/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -x "/Users/danielwaine/Desktop/HexWar/root/Temp/StagingArea/Data/preserved_derived_types.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/AI.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Animation.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Audio.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Cloth.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Core.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/CrashReporting.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/IMGUI.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Input.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/JSONSerialize.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/ParticleSystem.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/ParticlesLegacy.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/PerformanceReporting.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Physics.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Physics2D.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Terrain.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/TerrainPhysics.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/TextRendering.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/UI.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/UNET.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/UnityAds.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/UnityAnalytics.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/UnityConnect.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/UnityWebRequest.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/UnityWebRequestAudio.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/VR.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Vehicles.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Video.xml" -x "/Applications/Unity/PlaybackEngines/iOSSupport/Whitelists/Web.xml" -x "/Users/danielwaine/Desktop/HexWar/root/Assets/link.xml" -d "/Users/danielwaine/Desktop/HexWar/root/Temp/StagingArea/Data/Managed" -a "/Users/danielwaine/Desktop/HexWar/root/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll" -a "/Users/danielwaine/Desktop/HexWar/root/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" -a "/Users/danielwaine/Desktop/HexWar/root/Temp/StagingArea/Data/Managed/Assembly-UnityScript-firstpass.dll" -a "/Users/danielwaine/Desktop/HexWar/root/Temp/StagingArea/Data/Managed/Assembly-UnityScript.dll" -a "/Users/danielwaine/Desktop/HexWar/root/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll" -a "/Users/danielwaine/Desktop/HexWar/root/Temp/StagingArea/Data/Managed/DOTween.dll" -a "/Users/danielwaine/Desktop/HexWar/root/Temp/StagingArea/Data/Managed/DOTweenPro.dll" -a "/Users/danielwaine/Desktop/HexWar/root/Temp/StagingArea/Data/Managed/ES2.dll" -a "/Users/danielwaine/Desktop/HexWar/root/Temp/StagingArea/Data/Managed/TextMeshPro.dll"
     
  32. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,227
    Hi @CulzeanHexWar,

    I just made a test, and there's no issues in building for iOS with IL2CPP and DOTween on Unity 5.6. Why do you think it's involved? I'd suggest looking into something else.
    On a secondary note, are you using the new free TextMeshPro version? Because in that case you should get the latest DOTween Pro version from the private forums (coming to the Asset Store soon), otherwise it won't be recognized correctly.

    Cheers,
    Daniele
     
  33. CulzeanHexWar

    CulzeanHexWar

    Joined:
    Sep 18, 2015
    Posts:
    7
    Oh Sorry, I just needed to run re-import all on the project and that sorted things out. Whoops!
     
  34. CulzeanHexWar

    CulzeanHexWar

    Joined:
    Sep 18, 2015
    Posts:
    7
    I did get the new TextMeshPro, and have updated that. I may look into this update.
     
  35. Alexander-Seeck

    Alexander-Seeck

    Joined:
    Apr 29, 2015
    Posts:
    7
    @Izitmee is it possible to create a tween and forward it to some later time? I'd like to use the same yoyo tween several times, start them at once, but don't want them to look too equal. The opposite of SetDelay basically.
     
  36. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,227
  37. Alexander-Seeck

    Alexander-Seeck

    Joined:
    Apr 29, 2015
    Posts:
    7
    alright, thanks... I was trying the autocompletion for "Set", "Time" and "Offset". "Goto" did not come to my mind :)
     
  38. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    249
    I think I should have explained some things a bit better :p I was toggling the playing forward/backwards state of the sequence and then doing this:

    if (libraryExpandSequence.IsBackwards()) {
    libraryExpandSequence.Rewind();
    } else {
    libraryExpandSequence.Complete();
    }

    I was not using the OnRewind callback (maybe I should have, in retrospect), but simply an AppendCallback at the beginning of the sequence, which Rewind() doesn't trigger. I used AppendCallback because I wanted it to be called first when playing forward and last when playing backward (and it does), but when forcing it to the start with Rewind it doesn't. It doesn't need to; it makes sense as it is, but I wanted to see what could be done as an alternative. :)

    Either way, your reply has helped me conclude that moving my callback to a method and calling it on both OnRewind and AppendCallback works. Your last suggestion also works nicely (as long as you mean "PlayBackwards" :p), though I might refrain from using it because of the weirdness factor hehe.

    Thanks again! :)

    Daniel
     
  39. halflife

    halflife

    Joined:
    May 21, 2014
    Posts:
    34
    Hello,

    I have created a slider using UnityUI and tweened it like this
    Code (CSharp):
    1.  timerTween = timer.DOValue (0f, 60f).SetEase(Ease.Linear).OnComplete(()=>
    2. {
    3.             Debug.Log("Timer Over");
    4. });
    there are situations in the game when user gets bonus and that is added to the timer above, like this
    Code (CSharp):
    1. public void AddToTimer (float _sec)
    2.     {
    3.         timerTween.Pause();
    4.         _sec = timer.value + _sec;
    5.         if (_sec > 1000)
    6.             _sec = 1000;
    7.  
    8.         timer.DOValue (_sec, 1f).SetEase(Ease.Linear).OnComplete(()=>{
    9.           float _actualTime = timerTween.Duration() - timerTween.Elapsed();
    10.        timerTween = timer.DOValue(0f, _actualTime).SetEase(Ease.Linear);
    11.         });
    12.     }
    every Right answer adds 100 bonus time and every wrong answer subtracts 100 time value from current time remaining and max limit slider value is 1000 and in 60 Sec it comes to 0.

    the issue i am facing is that the timer starts to play from the previous point after adding the bonus time..i want to be able to add/subtract time from current timer and timer should play from the new calculated point. All this happens while animating using DoTween.
    Any Suggestions how to use Dotween to do this.
     
    Last edited: Apr 9, 2017
  40. DeuS

    DeuS

    Joined:
    Feb 8, 2013
    Posts:
    17
    Hi, it is possible to manual update tween(all tweens)? Without dependence in Unity update?
    For example I need simulate 1000 ticks in game, and this ticks do not depend in Unity, just FOR cycle and with every tick I execute some logic which contains tweens.
     
  41. supremegrandruler

    supremegrandruler

    Joined:
    Jul 19, 2014
    Posts:
    1,103
    Can we get the DotweenAnimation component to have tween by percentages as well as fixed value? I want to scale an object to x times its current size, etc.
     
  42. bigSky

    bigSky

    Joined:
    Jan 31, 2011
    Posts:
    113
    There's a bug with DoTween Pro > Path on a macbook pro, unity 5.6, Sierra, where paths are not created under the cursor, but off somewhere else in the screen. I predict that it is something to do with screen size. But, nevertheless, makes the feature unusable.
     
  43. Brad-Newman

    Brad-Newman

    Joined:
    Feb 7, 2013
    Posts:
    108
    I'm trying to use OnWaypointChange and for some reason when the tweened object reaches the last waypoint OnWaypointChange is returning all the waypoints again, including one that doesn't exist (_waypoints[3]). Maybe a bug?

    Code (CSharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using DG.Tweening;
    6.  
    7. public class PathTest : MonoBehaviour {
    8.  
    9.     public GameObject waypoint1;
    10.     public GameObject waypoint2;
    11.     public GameObject waypoint3;
    12.     private Vector3[] _waypoints;
    13.     private Vector3 _startPosition;
    14.     private Quaternion _startRotation;
    15.  
    16.     void Start () {
    17.         _waypoints = new Vector3[]
    18.                     {
    19.                         waypoint1.transform.position,
    20.                         waypoint2.transform.position,
    21.                         waypoint3.transform.position
    22.                     };
    23.  
    24.         _startPosition = transform.position;
    25.         _startRotation = transform.rotation;
    26.     }
    27.    
    28.     void Update ()
    29.     {
    30.         if(Input.GetKeyUp(KeyCode.Space))
    31.         {
    32.             StartPath();
    33.         }
    34.         Debug.DrawRay(transform.position, transform.forward * 3f, Color.magenta);
    35.     }
    36.  
    37.     void StartPath()
    38.     {
    39.         Debug.Log("_waypoints.Length: " + _waypoints.Length);
    40.  
    41.         transform.DOKill();
    42.         transform.position = _startPosition;
    43.         transform.rotation = _startRotation;
    44.  
    45.         transform.DOPath(_waypoints, 10f, PathType.CatmullRom, PathMode.Full3D, 10, Color.red)
    46.                     .SetLookAt(.01f)
    47.                     .OnWaypointChange(LogWaypoint);
    48.     }
    49.  
    50.     void LogWaypoint(int waypointIndex)
    51.     {
    52.         Debug.Log("waypointIndex: " + waypointIndex);
    53.     }
    54. }
    55.  
    56. /*
    57. //Debug Log Output
    58. waypoints.Length: 3
    59. waypointIndex: 0
    60. waypointIndex: 1
    61. waypointIndex: 2
    62. //then when the tween object reaches _waypoints[2], it logs the following:
    63. waypointIndex: 0
    64. waypointIndex: 1
    65. waypointIndex: 2
    66. waypointIndex: 3 //This doesn't exist...not sure what that's about.
    67. */
    68.  
    On a side note, its seems like DOPath().SetLookAt(lookAhead) percentage has to be .01 to make the forward Z direction follow the path. The docs say this value goes from 0-1. My expectation was that setting it to 1 would make the Z forward direction follow the path. Setting it to 1 appears to make it point at the last waypoint, which was not what I intuitively thought would happen based on the wording of the docs.
     
  44. mmortall

    mmortall

    Joined:
    Dec 28, 2010
    Posts:
    79
    I've found BUG.

    Code (CSharp):
    1. tweener.SetAutoKill(false);
    2. tweener.Goto(tweener.Duration(false));
    3. tweener.SetDelay(DelayTime);
    4. tweener.PlayBackwards();
    SetDelay does not work in this case! But SetDelay should works. Tween was stopped before.
     
  45. Airan

    Airan

    Joined:
    Sep 11, 2014
    Posts:
    6
    Hello there,

    Thank you for releasing this library for use. I've been caching a sequence before the game starts, and it appears that it literally caches values at the load time instead of dynamically referring to variables at runtime. Is there a way to make the sequence refresh so as to get the updated values?

    e.g.

    Code (csharp):
    1. float score { get; set; }
    2. float multiplier { get; set; }
    3. Sequence sq;
    4.  
    5. public void Setup()
    6. {
    7.   sq = DOTween.Sequence();
    8.   sq.Append(DOTween.To(x => score = x, score, score * multiplier, 0.5f));
    9. }
    10.  
    11.  
    12. //... when displaying results animation
    13. public void StartResultsAnim()
    14. {
    15.   sq.Play();
    16. }
    17.  
    the Score value at the time of setup is 0, as is the multiplier value, which causes the animation to play out a tween displaying the score as 0 instead of its true value.
     
  46. Nikolasio

    Nikolasio

    Joined:
    Dec 6, 2014
    Posts:
    45
    Hi,

    I'm getting this error message:
    error CS1928: Type `UnityEngine.Transform' does not contain a member `DOMove' and the best extension method overload `DG.Tweening.ShortcutExtensions.DOMove(this UnityEngine.Transform, UnityEngine.Vector3, float, bool)' has some invalid arguments

    for this basic line of code:
    Code (CSharp):
    1. this.gameObject.transform.DOMove(ray.origin, 0.5).SetEase(Ease.InOutQuad);
    I'm using version 1.1.575 and when I'm trying to import the current version 1.1.595 via the site I'm downloading a map with a .dml, .dll, .xml and some .addon's.

    How do I upgrade?
    And where does the error come from?

    Cheers,
    Nikola
     
  47. Airan

    Airan

    Joined:
    Sep 11, 2014
    Posts:
    6
    I think you need to set the correct data type for float:

    Code (CSharp):
    1. this.gameObject.transform.DOMove(ray.origin, 0.5f).SetEase(Ease.InOutQuad);
     
  48. Nikolasio

    Nikolasio

    Joined:
    Dec 6, 2014
    Posts:
    45
    I missed that, big thx!
     
  49. ooblii

    ooblii

    Joined:
    Feb 23, 2013
    Posts:
    30
    @Izitmee I'm running into an issue using DOShakeRotation and UNET. It works as expected when running offline, but when networked with UNET, the tweened transform's rotation doesn't return to the original rotation. It also happens with DOPunchRotation. I can't tell if it's a bug or not, but here is the basics of the code:

    Code (CSharp):
    1.  
    2. CmdShakeShield();
    3.  
    4. [Command]
    5. void CmdShakeShield()
    6. {
    7.     RpcShakeShield();
    8. }
    9.  
    10. [ClientRpc]
    11. void RpcShakeShield()
    12. {
    13.     ShakeShield();
    14. }
    15.  
    16. void ShakeShield()
    17. {
    18.     myShield.transform.DOShakeRotation(.5f,50f,10,0,true);
    19. }
    20.  
    Interestingly, it only happens from host to client. Calling the method client to host, the tween works as expected and stays at the original rotation. Any help would be greatly appreciated. When I have the time, I can setup a dummy project to illustrate the issue. Thanks!


    ps. Great work! Just bought the Pro version, looking forward to digging into the added features.
     
  50. flyinghigh

    flyinghigh

    Joined:
    Oct 23, 2013
    Posts:
    1
    hello,I am using unity 5.5.1f1,and i am making a tracking system.
    In my work,you can add several points in the scene,i use linerender to render the path and then use dotween to make the object tween from the first point to the end.
    But then i found a problem.
    I will show you bellow:
    Code (CSharp):
    1.  GameObject audioObject = GameObject.Find(IDName).gameObject;
    2.                     if (PointPositions != null)
    3.                     {
    4.                         DOTween.Kill(audioObject, true);
    5.                         mTweener.Kill(true);
    6.                         if (PointPositions.Count >= 2)
    7.                         {
    8.                             mTweener = audioObject.transform.DOPath(PointPositions.ToArray(), float.Parse(trackTimeText.text),
    9.                                 (curveTypeCombox.selectedIndex == 0) ? PathType.Linear : PathType.CatmullRom, PathMode.Full3D, 10, Color.green)
    10.                                .SetAutoKill(false).SetDelay(float.Parse(trackTimeDelayText.text)).SetEase(thisEase);
    11.                             mTweener.SetLoops((curveCycleButton.selected ? -1 : 1), LoopType.Restart);
    12.                             mTweener.Goto(0, false);
    13.                             MainController _mainController = GameObject.Find("SceneManager").GetComponent<MainController>();
    14.                             _mainController.setBallPointsNotMove();
    15.                         }
    16.                     }
    When i set the tween 's loop from -1 to 1, the tween show two different results.
    when tween turn to loop forever,mtweener.goto(0,false) code transform the obj's position to the end of PointPositions.ToArray().
    when tween turn to not loop,the code transform the obj's position to the start point of the PointPositions.ToArray().
    And i do not know why,i have check the data of the PointPositions.ToArray(),in these two situations,it is the same data.Can you help?