Search Unity

DOTween (HOTween v2), a Unity tween engine

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

  1. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @electroflame The approach suggested by @zhuchun is definitely the way to go.

    @kobyle "Fast but no exceptions" still allows for try-catch blocks to be active, which is one of the things that allows the safe mode to work, so yes, safeMode on will still make a difference (that is, unless you set the stripping level to max, in which case try-catch blocks won't work anymore).

    @romi.fauzi Glad you solved it, but if you could send me the repro anyway it would be great, so that I can squash it too. Sent you a PM with my mail address.

    @anuj You could set the ease to Linear, in which case 0.5 duration will be equal to half the path.

    @wxxhrt Got it. Hope to be able to work on it this evening.

    @juicymangoz You could also do this (which takes into account yoyo loops too):
    Code (csharp):
    1. float currPositionLoopsExcluded = myTween.ElapsedDirectionalPercentage() * myTween.Duration(false);
    2. myTween.Goto(currPositionLoopsExcluded);
    3. myTween.PlayBackwards();
    Consider though that this won't kill the tween when it's rewinded. Otherwise, your last solution is better.
     
  2. anuj

    anuj

    Joined:
    Jun 15, 2015
    Posts:
    28
    i know that 0.5 will set the position equal to half of the path , but when i want to continue on that path using twen.play() it jumps back to start of path and starts from there
     
  3. kobyle

    kobyle

    Joined:
    Feb 23, 2015
    Posts:
    92
    @Izitmee, I see.. maybe it really has to do with the stripping.
    Just being curious, wouldnt it be possible to check if the object is null ? rather than surround it with try catch?
    Or it will make the code a lot more complex?
     
  4. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Hi,

    I just bought the Pro version to use it with TextMeshPro.

    But I have som error when I use it :

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(150,99): error CS1929: Extension method instance type `TMPro.TextMeshPro' cannot be converted to `UnityEngine.SpriteRenderer'


    Any idea ?

    Thanks a lot !
     
  5. Mr_Cad

    Mr_Cad

    Joined:
    Dec 7, 2013
    Posts:
    27
    I have two tweeners in a sequence.
    I try to set a OnPlay/OnStart callback on one of my tweeners. I noticed it only get called once when I start running the sequence. After that if I restart the sequence, both OnPlay/OnStart doesn't get called anymore.
     
  6. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    Hi, can we set loops interval in DOTweenAnimation window? It seems interval is a property of sequence but DOTweenAnimation is a Tween in fact, any workaround? Thanks
     
    Last edited: Sep 11, 2015
  7. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422

    Did you Setup DOTween again? You've to run the DOTween Setup (found at: Tools -> DOTween Utility Panel) so it'll re-import specific libraris/scripts with specific using TMPro directives.
     
  8. kobyle

    kobyle

    Joined:
    Feb 23, 2015
    Posts:
    92
    Hi,

    I'm trying to restart a sequence after it's being killed by DOTween.KillAll();

    Code (CSharp):
    1.  
    2. void Awake()
    3. {
    4.     m_Sequence = DOTween.Sequence();
    5.     playSequence();
    6. }
    7.  
    8. private void playSequence()
    9. {
    10.     m_Sequence.Append(TextToAnimate.transform.DOScale(-ScaleValue, Duration).SetRelative(true))
    11.              .Append(TextToAnimate.transform.DOScale(ScaleValue, Duration).SetRelative(true)).SetLoops(-1).SetAutoKill(false).SetRecyclable(true).OnKill(killed);
    12. }
    13.  
    14. void killed()
    15. {
    16.     Debug.Log("killed");
    17.     m_Sequence.SetUpdate(true);
    18.     m_Sequence.Rewind();
    19.     m_Sequence.Play();
    20.     m_Sequence.Restart();
    21. }
    22.  
    1. How do I restart a killed sequence.
    2. How can I see many tweens are inside a sequence?
    3. Are tweens
    Also, is it possible to know how much tweens inside a sequence?
     
  9. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @anuj That shouldn't happen, I will check that out. In the meantime try using Goto(0.5f) instead of the fullPosition variable.

    @kobyle Try catch is much more efficient, because there are many places where an object could become NULL during the update of a tween (it could be destroyed inside any of the callbacks or something like that).

    A tween/Sequence cannot be restarted after it has been killed. Killing it means destroying it, so you'll have to recreate it.

    No way to know how many tweens are inside a Sequence, sorry. Can you tell me why you'd need that? If it's important, I could implement it (@BTStone got the right solution, thanks).

    @ababab5 Solved on DOTween's forum (it was you, right?).

    @Mr_Cad OnStart is calling only once, when the tween starts up the very first time. OnPlay is called only if the tween was previously set in a paused state, which doesn't happen if you call Restart while playing.

    @zhuchun You mean like adding an interval at the end of a Sequence? Can't be done right now (but I'm slowly working on a Sequence option for the visual editor), but as a workaround, you could create a custom ease curve, and set the last part of the curve to 1, so the tween would actually look as it reached the end, paused, and then looped.
     
  10. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    Ah, brilliant idea! :D
     
  11. kobyle

    kobyle

    Joined:
    Feb 23, 2015
    Posts:
    92
    Code (CSharp):
    1. someSeq....AppendCallback(() => func1(num));
    2.  
    3. void func1(int num)
    4. {
    5. }
    this works as expected, while:

    Code (CSharp):
    1. someSeq....AppendCallback(func1(num));
    2.  
    3. TweenCallback func1(int num)
    4. {
    5.    // do some stuff
    6.     return null
    7. }
    fires at the beggining of the sequence.

    So few questions:
    1. Could you explain how exactly that "() => void(params)" works? is it an anonymous func, a linq way to call a func or what?
    2. What can I put inside the first "()" - I saw in linq I can put there input params?
    3. DOTween.Sequence().ApeendCallback(()=> [how can I access the sequence to do a rewind for example?])
    4. Is it possible to implement a TweenCallback, what should I return in that case (null)?

    Thanks,
    Koby
     
  12. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Hey Koby!

    1. The callback parameter is a simple Action, which means that, without lambda, you can only pass it a reference to a parameter-less function. If instead you use a lambda, you create an anonymous function and yes, you can call any method you want, or create multiple lines of code.
    2. You can't put anything inside the first lambda's "()", because that would work only if the callback actually returned something (in which case if you put something there it would be a reference to the returned value).
    3. Just use your Sequence reference (note that, if the Sequence has already completed, it won't rewind unless you set autoKill to false):
    Code (csharp):
    1. someSeq.Rewind();
    4. Not sure what you mean here. Can you explain me more?
     
  13. miyacchi

    miyacchi

    Joined:
    Mar 27, 2015
    Posts:
    10
    I wanna use path for editing to make some objects align on the path.
    So I've tried to make editor script and try to get the points on the path via

    GetComponent<DOTweenPath> ().GetTween ().PathGetPoint (x)

    But GetTween returns null when editing.

    Let me know how do you draw the gizmo of path when editing?
     
  14. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @miyacchi Just added a new method which can be accessed directly for a DOTweenPath component, GetDrawPoints. Grab it here (if you don't have access to the private download area, follow these instructions).

    P:S. that is not the same as PathGetPoint, which works only at runtime, but I hope it'll be good enough for your usage
     
  15. TechiTech

    TechiTech

    Joined:
    Dec 13, 2014
    Posts:
    212
    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(150,99): error CS1928: Type `TMPro.TextMeshPro' does not contain a member `DOColor' and the best extension method overload `DG.Tweening.ShortcutExtensions43.DOColor(this UnityEngine.SpriteRenderer, UnityEngine.Color, float)' has some invalid arguments

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(150,99): error CS1929: Extension method instance type `TMPro.TextMeshPro' cannot be converted to `UnityEngine.SpriteRenderer'

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(200,99): error CS1928: Type `TMPro.TextMeshPro' does not contain a member `DOFade' and the best extension method overload `DG.Tweening.ShortcutExtensions43.DOFade(this UnityEngine.SpriteRenderer, float, float)' has some invalid arguments

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(200,99): error CS1929: Extension method instance type `TMPro.TextMeshPro' cannot be converted to `UnityEngine.SpriteRenderer'

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(249,107): error CS1928: Type `TMPro.TextMeshProUGUI' does not contain a member `DOText' and the best extension method overload `DG.Tweening.ShortcutExtensions46.DOText(this UnityEngine.UI.Text, string, float, bool, DG.Tweening.ScrambleMode, string)' has some invalid arguments

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(249,107): error CS1929: Extension method instance type `TMPro.TextMeshProUGUI' cannot be converted to `UnityEngine.UI.Text'

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(250,99): error CS1928: Type `TMPro.TextMeshPro' does not contain a member `DOText' and the best extension method overload `DG.Tweening.ShortcutExtensions46.DOText(this UnityEngine.UI.Text, string, float, bool, DG.Tweening.ScrambleMode, string)' has some invalid arguments

    Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs(250,99): error CS1929: Extension method instance type `TMPro.TextMeshPro' cannot be converted to `UnityEngine.UI.Text'
     
  16. TechiTech

    TechiTech

    Joined:
    Dec 13, 2014
    Posts:
    212
    // NOTES //////////////////////////////////////////////////////


    - DOTween's Utility Panel can be found under "Tools > DOTween Utility Panel" and also contains other useful options, plus a tab to set DOTween's preferences


    But I don't see Tools menu
     
  17. TechiTech

    TechiTech

    Joined:
    Dec 13, 2014
    Posts:
    212
    no worries... fixed now
     
  18. kobyle

    kobyle

    Joined:
    Feb 23, 2015
    Posts:
    92
    Heya @Izitmee,

    Thanks for your reply, it makes more sense now.

    For another matter, I'm still struggling with eliminating the exceptions that rises since I dont wish to use safe mode.
    What I have atm, are tweens that are attached to objects that are being destroyed on gameover.
    In order to solve this, I use DOTween.KillAll(); right before my scene dies, and it seems to work well.

    However, now I have a situation where I would like to use the KillAll method but without killing 2 specific tweens.
    Is it possible to make a KillAll function that takes IDs as parameter, and the tweens with the specified ids wont get killed?

    Koby
     
    Devil_Inside likes this.
  19. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @TechiTech Glad it's fixed now :)

    @kobyle Mhmm no method like that exists, but it makes sense and I'm gonna add it to my todo list. If I finish the job I'm doing within the afternoon, I might be able to add it this evening. Crossing my fingers.
     
    Devil_Inside likes this.
  20. kobyle

    kobyle

    Joined:
    Feb 23, 2015
    Posts:
    92
    Ok great! looking forward for it :) thx

    Koby
     
  21. anuj

    anuj

    Joined:
    Jun 15, 2015
    Posts:
    28
    when i play a path tween and its set as infinite incremental loop , it plays fine , but when i flip the tween it plays backward untill it comes back to its original place and after that it stops playing when it reaches start position ;

    for example if pathTween played 4 loops in infinite loop mode set as incremental , when it is flipped it will play 4 loops backward and then it stops

    is there any way to make it play backwards infinitely and incremental as well when i flip it .


    also is there any way to teleport the object moving on path , so that it continue its remaining path tweening from the new teleported location
     
  22. kobyle

    kobyle

    Joined:
    Feb 23, 2015
    Posts:
    92
    One more thing:

    Is it possible to know how many tweens a gameobject.transform has running?
    Incase I have a sequence with 2 tweens.
    Is it possible to know they are running or the count of them, by querying the target gameobject somehow?

    It would help to make double sure all the tweens are killed/gone.
     
  23. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    NEW DOTWEEN UPDATE 1.0.830
    • NEW: Added DOTween.KillAll overload which accepts excluded list of ids and targets
    • BUGFIX: Added missing Material operation shortcuts
    • BUGFIX: Fixed OnPlay not being called when a tween restarts
     
    zhuchun likes this.
  24. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @kobyle Voilà (see the update) :) About checking how many tweens are running on a target, you can't. But you can check IF any tween is running on a target, with IsTweening.

    @anuj Sorry but no, once a tween reaches its starting position it will stop. Instead, to teleport to a given time position, you can use Goto.
     
  25. miyacchi

    miyacchi

    Joined:
    Mar 27, 2015
    Posts:
    10
    Thanks!

    I'll try that!
     
  26. kobyle

    kobyle

    Joined:
    Feb 23, 2015
    Posts:
    92
  27. kobyle

    kobyle

    Joined:
    Feb 23, 2015
    Posts:
    92
    Hi,

    Any reason why this doesnt loop the DOScale? it only happens once.

    Code (CSharp):
    1.            
    2. m_ImageToTween.fillAmount = 0;
    3. DOTween.Sequence().SetUpdate(true).SetAutoKill(false).SetRecyclable(true)
    4.                  .Append(m_ImageToTween.DOFillAmount(1, 1.0f))
    5.                  .Append(m_ImageToTween.transform.DOScale(0.75f, 0.5f).SetLoops(-1, LoopType.Yoyo));
     
  28. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @kobyle Hi! Infinite loops don't work inside a Sequence (tweens nested in a Sequence need to have a known duration). If you just set it to 9999999999 it will though.
     
    kobyle likes this.
  29. kobyle

    kobyle

    Joined:
    Feb 23, 2015
    Posts:
    92
    Heya, two more questions if I may:

    Question 1:
    If I have a function and I want it to operate in the following manner:

    1. do some tweens (duration of 1.0f)
    2. do some regular code (about 10 lines of code which call other functions and stuff)
    3. do some tweens

    It need to be executed 1->2->3 in a chronological order.

    Is there some elegant way to accomplish that without breaking my func into sub funcs, and mess with the oncomplete callback?

    Question 2:
    If I have a sequence with tweens, and that sequence got killed, is it possible to restart the sequence and its' tweens?

    Thank you,
    Koby
     
    Last edited: Sep 18, 2015
  30. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @kobyle Hiya!

    Question 1
    You can do that with a Sequence:
    Code (csharp):
    1. mySequence = DOTween.Sequence();
    2.    .Append(...someTweens...)
    3.    .AppendCallback(()=> {
    4.       // 10 lines of code
    5.    })
    6.    .Append(...someOtherTweens...);
    Question 2
    Once a Sequence is killed there's no way to restart it. It's dead, done, gone! No zombie tweens exist in DOTween :D
     
    kobyle likes this.
  31. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    Hi, report a conflict issue here. It's NOT a DOTween problem but it affect DOTween.
    I purchase another asset named Mesh Maker https://www.assetstore.unity3d.com/en/#!/content/11625 . Their dll have an Ease class w/o namespace that makes editor throw a exception said Ease.INTERNAL_Custom doesn't exists(in DOTweenAnimationInspector). To make it through, need to use DG.Tweening.Ease(enum) instead.
     
  32. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Ouch, an Ease class without namespace is very evil :p Maybe you could write to Mesh Maker's author and ask him to add namespaces?
     
  33. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    Ya, I did that
     
  34. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
  35. DarkSlash

    DarkSlash

    Joined:
    Sep 30, 2011
    Posts:
    127
    I have a float variable called balance and I show it in a 2d Toolkit TextMesh. Right now, Im doing something like this to change it:
    Code (csharp):
    1. balance += totalPayment;
    2. UpdateUI();
    But I don't want to change the value from A to B. Let's say balance = 50 and totalPayment = 150, I want to increase it 50,51,52,53 (or something like that) until 200 (balance + totalPayment). So the closest I got is this:

    Code (csharp):
    1. float to = balance + totalPayment;
    2. DOTween.To(() => balance, x => balance = x, to, 2).OnComplete(UpdateUI);
    UpdateUI just take does this: txtBalance.text = balance.ToString("F2");

    Nevertheless, this doesn't work as expected. It doesn't do what I need, it just wait 2 seconds and then change the value of balance to balance+totalPayment. What I'm doing wrong?
     
  36. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Hi, copy-pasting here what I wrote in DOTween's forum (let's continue the conversation here):

    Your code is absolutely correct and should do the animation you intend. I'm sure there's no bugs in float tweens, so maybe there's something else blocking your tween from happening? Like a method somewhere setting "balance" continuously, or Time.timeScale being set to 0 (in which case you will have to chain a SetUpdate(true) to make the tween independent).

    Let me know.
     
  37. dl_studios

    dl_studios

    Joined:
    Oct 14, 2012
    Posts:
    76
    @Izitmee First off we love DOTween! It's super flexible and well thought.

    We are using it to make a runtime keyframe animation system for our game and have been able to get it to animate all transform properties well except rotation.

    Our animation system is simple. A player moves a gameObject and presses a button to capture a keyframe. In code we store the objects transform values. When we go to play the animation, we simply append each keyframe to a sequence. This is problematic when the axis cross certain thresholds. For example the below script we would expect to simply turn the object on the x until its back to the same position. However, when the animation tries to make the 180 to 270 jump it twists around weird to reach its position. This really cramps the style of our animation system, because its unexpected behaviour. We suspect gimbal lock is to blame. Slap the below code on a cube to see what we mean.

    Is there any solution where we can get the keyframes to act naturally? Have you considered having a rotation by Quaternions to avoid the gimbal lock weirdness?

    Thank you for looking at this!

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using DG.Tweening;
    5.  
    6. public class KeyFrameDOTweenTest : MonoBehaviour {
    7.  
    8.     Transform theTransform;
    9.     public float duration = 10;
    10.     // Use this for initialization
    11.     void Start () {
    12.         theTransform = this.transform;
    13.         Rotate_Fast_90DegreeIncrementsOnX();
    14.  
    15.     }
    16.  
    17.  
    18.     private void Rotate_Fast_90DegreeIncrementsOnX()
    19.     {
    20.  
    21.         Vector3 setToZeroRotation = Vector3.zero;
    22.         theTransform.rotation = Quaternion.Euler(setToZeroRotation);
    23.  
    24.         Vector3 target2 = new Vector3(90, 0, 0);
    25.         Vector3 target3 = new Vector3(180, 0, 0);
    26.         Vector3 target4 = new Vector3(270, 0, 0);
    27.         Vector3 target5 = new Vector3(360, 0, 0);
    28.  
    29.         var averagedDuration = duration / 4;
    30.        
    31.  
    32.         Sequence sequence = DOTween.Sequence();
    33.         sequence = DOTween.Sequence();
    34.         sequence.Append(theTransform.DOLocalRotate(target2, averagedDuration, RotateMode.Fast));
    35.         sequence.Append(theTransform.DOLocalRotate(target3, averagedDuration, RotateMode.Fast));
    36.         sequence.Append(theTransform.DOLocalRotate(target4, averagedDuration, RotateMode.Fast));
    37.         sequence.Append(theTransform.DOLocalRotate(target5, averagedDuration, RotateMode.Fast));
    38.  
    39.     }
     
    Last edited: Sep 21, 2015
  38. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    Uhm, question: Can I use DOTween (directly) to animate the intensity value of a light on a GameObject? Without going through some intermediary float value, I mean.
     
  39. dl_studios

    dl_studios

    Joined:
    Oct 14, 2012
    Posts:
    76
    @Izitmee Another unrelated question, is there a way to have a tween with no ease--(linear ease is the default, correct?). We could find a lot about the many ease types you have available but nothing in the docs about having zero ease. Thank you!
     
  40. dl_studios

    dl_studios

    Joined:
    Oct 14, 2012
    Posts:
    76
    Hi @Bradamante
    myLight.DOIntensity(float to, float duration) will likely do what you want.
     
    Last edited: Sep 22, 2015
  41. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Hi @dl_studios, glad you like it :)

    I'm on a prototype in crunch mode for the next two days, but I'll try to find the time to check your issue. If not I apologize, and I'll get on it Thursday. A straight Quaternion tween is sadly not possible, because it wouldn't allow to tween single axes or stuff like that.

    About the "no ease", Linear ease is actually no ease at all. The default ease is OutQuad, not Linear, but if you want you can set it as default either via code with DOTween.defaultEaseType, or using the Utility Panel.
     
  42. dl_studios

    dl_studios

    Joined:
    Oct 14, 2012
    Posts:
    76
    @Izitmee Thanks! That makes sense that Linear ease is no ease at all. I should have realized that.

    As to Quaternion rotation, we wouldn't need to tween individual axes. We just need to match a target rotation value. It would be extremely valuable for us to have a transform quaternion rotate where we simply hand in the quaternion target rotation, an ease, and a duration, and not have to worry at all about gimbal lock.

    My understanding of the issue is that with Euler rotation, gimbal lock is unavoidable if you allow rotation in 360 degrees on all axes(in unity its the X axes that causes the issue). This video illustrates the gimbal lock well.

    Am a bit embarrassed to admit it but we've spent the last two days trying to figure out what exactly is going wrong with rotation and how to fix it while still using Euler angles. We've come to the conclusion (perhaps wrong) that Euler angles are too limited for certain rotation combinations, if trying to get a smooth transition between two rotations.

    Thank you for taking a look at this!
     
  43. AwesomeX

    AwesomeX

    Joined:
    Sep 10, 2013
    Posts:
    115
    I've been looking through the documentation, and have setup a sequence for my HUD. However, I can't find any info on how I could control these tween's properties at runtime, such as the speed of the tween?
     
  44. dl_studios

    dl_studios

    Joined:
    Oct 14, 2012
    Posts:
    76
    @AwesomeX I may be wrong here, but I don't think its possible to change a sequence speed at runtime because a sequence doesn't have a duration-- it relies on the tweeners for its speed. A sequence simply helps in organizing tweeners.

    On the other hand Tweeners have a ChangeValue method where you can change the values at run time on an individual tween. It does have the limitation however that if you place the tweener in a sequence you can no longer modify that tweeners values. Check out the below code.

    Code (csharp):
    1.  
    2.  
    3. private Tweener _tweener;
    4.  
    5. void Start () {
    6.  
    7.         SpeedChangeTest();
    8.     }
    9.  
    10.    
    11.     private void SpeedChangeTest()
    12.     {
    13.         _tweener = transform.DOMove(Vector3.up * 10, 15);
    14.     }
    15.  
    16.  
    17.     void Update()
    18.     {
    19.  
    20. ///here we change the speed by setting the start position to where where the object currently is so it doesn't jump to a //random position.
    21.         if(Input.GetKeyDown(KeyCode.A)){
    22.  
    23.             _tweener.ChangeValues(transform.position, Vector3.up * 10, 1);
    24.  
    25.         }
    26.     }
    27.  
    28.  
    With sequences you can set up certain eases that give you a variety in speed, but the ease won't affect the the overall duration.

    Hope that helps some.
     
    Last edited: Sep 25, 2015
  45. meapps

    meapps

    Joined:
    May 21, 2013
    Posts:
    167
    cant get the build for the windows iphone working:

    I use the DoTween Pro Version

    Error building Player: UnityException: Failed to run serialization weaver with command "Temp\StagingArea\Data\Managed\DOTween46.dll" -pdb -verbose -unity-engine="Temp\StagingArea\Data\Managed\UnityEngine.dll" "Temp\StagingArea\TempSerializationWeaver" -additionalAssemblyPath="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsPhone\v8.0".
    Symbols will be read from Temp\StagingArea\Data\Managed\UnityEngine.pdb
    Weaving assembly C:\Projects\QuarthLatest\Temp\StagingArea\Data\Managed\DOTween46.dll
    Symbols will be read from Temp\StagingArea\Data\Managed\DOTween46.pdb
    System.InvalidOperationException: Der Vorgang ist aufgrund des aktuellen Zustands des Objekts ung�ltig.
    bei Mono.Cecil.ModuleDefinition.ProcessDebugHeader()
    bei Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
    bei Mono.Cecil.ModuleReader.CreateModuleFrom(Image image, ReaderParameters parameters)
    bei Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
    bei usw.Weaver.WeaveAssembly(String assemblyPath, AssemblyDefinition unityEngineAssemblyDefinition)
    bei usw.Weaver.Weave()
    bei usw.Program.RunProgram(ConversionOptions options)
    bei usw.Program.Main(String[] args)
     
  46. deekpyro

    deekpyro

    Joined:
    Oct 16, 2012
    Posts:
    71
    Hey Izitmee - thanks for putting together DOTween. Is there any built-in way to have an object follow a path and set the rotation of the object based on Slerp’d rotation values of the waypoints? As in, the object will have the same forward direction as the transform as it passes through it.

    I don’t see anything like this under the SetLookAt() options.

    Thanks!
     
  47. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    NEW DOTWEEN UPDATE v1.0.850
    • NEW: Added Material/SpriteRenderer/Image.DOGradientColor shortcuts
    • BUGFIX: Fixed DOJump not working correctly with Rigidbody2D

    @deekpyro Hi! I'm sorry but I didn't understand. Can you explain me better?

    @meapps Hey, replace the DOTween folder with the hyper-compatible version you can download from the link above. You're encountering a Unity bug and the Unity team said they're fixing it, but in the meantime the hyper-compatible version will solve it.

    @dl_studios Apologies for my lateness, but crunching lasted a lot more than I hoped for. I hope to check out your issue next week asap (which I did check, but might take some time).
     
  48. deekpyro

    deekpyro

    Joined:
    Oct 16, 2012
    Posts:
    71
    @Izitmee I am using DOTween to direct camera movements for cutscenes and such. I create the waypoint transforms to be looking where I want the camera to look. Currently I can only have the camera look at a position or a transform while traversing the path which is not ideal.
     
  49. meapps

    meapps

    Joined:
    May 21, 2013
    Posts:
    167
    @Izitmee i got it working but have big slowdowns with the game on an windows phone. Android works fine.

    Fixed it there were some issue because of the new DoTweenPro update.
     
    Last edited: Sep 27, 2015
  50. Virdari

    Virdari

    Joined:
    Aug 19, 2014
    Posts:
    14
    Hey, bought your asset so far i'm enjoying it. Came across a little issue though
    IEnumerator rotate(){
    while (true) {
    Tween mytween = transform.DORotate (newVector3 (0, transform.rotation.eulerAngles.y + 360, 0), 3, RotateMode.FastBeyond360);
    yield return mytween.WaitForCompletion ();
    }
    }​
    I'm using a Coroutine like this, starting it from inside void Start(), I just want my gameObjects to rotate forever. The problem I have is that sometimes my game objects will freeze(Tweens are still probably active but they're not rotating at all). What is the best way to have constantly rotating objects using your plugin ?
     
    Last edited: Sep 27, 2015