Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

DOTween (HOTween v2), a Unity tween engine

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

  1. Gruguir

    Gruguir

    Joined:
    Nov 30, 2010
    Posts:
    316
    Using your example its going from world pos 0 to world pos -1 then back to 0. Looks like for some reason it doesn't take the .'ChangeStartValue(transform.localPosition.x + amplitude)' into account ?
     
  2. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    399
    @Gruguir Sorry, my mistake. You have to pass a Vector3 to .ChangeStartEndValue. This works as expected:

    Code (CSharp):
    1. transform.DOLocalMoveY(transform.localPosition.y - amplitude,duration)
    2.             .ChangeStartValue(new Vector3(transform.localPosition.x, transform.localPosition.y+ amplitude, transform.localPosition.z))
    3.             .SetLoops(-1,LoopType.Yoyo)
    4.             .SetEase(Ease.InOutSine)
    5.             .Goto(duration/2,true);
     
  3. Gruguir

    Gruguir

    Joined:
    Nov 30, 2010
    Posts:
    316
  4. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    369
    I am using code and the "Do Tween Animation Component" (DTAC) to animate and object. I am basically using the DTAC for the animation and OnPlay & OnComplete functions...it makes it really east to chain things like audio together.

    My issue is this..

    The tween starts and stops as normal the first time.

    When I try to play it again, it doesn't play. I've tried tried setting the AutoKill On and Off...I'm tried restarting the tween, rewinding...but nothings seems to work.


    I've noticed that the tween is paused but it never comes back out of that state. How to I unpause it so that it can be reused?

    I have the tweens that dont have this issue...not sure why this particular one is an issue.
     
  5. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    570
    Hello,
    does DOTween Pro support paths that are local to a parent gameObject?
    Can we arbitrarily transform said gameObject and the path rotates, moves or scales nicely along?
    This is a selling point to us. Thx.
     
  6. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,228
    IMPORTANT MESSAGE: On Windows 10 UWP DOTween's safe mode will cause crashes. That's because Unity's compilation for that platform apparently doesn't support try-catch calls correctly. I talked with Unity for a solution (they're fixing it, but in the meantime I'm removing try-catch calls - it's a very long and complicated thing, so bear with me).

    While waiting for me to fix this (hopefully within the week), the temporary fix is to disable safe mode (from DOTween's preferences). This will mean though that you will have to take care of killing any tween before their target becomes NULL, otherwise you will get regular NullReferenceExceptions.
     
    Last edited: Oct 12, 2016
    leni8ec and vladimirta89 like this.
  7. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    570
    Hi Izitmee,
    care to answer my question one post above your last one?
     
  8. gpvd

    gpvd

    Joined:
    Nov 2, 2013
    Posts:
    76
    Hello Izitmee,

    I've a little question;

    Is it possible to play tweens/sequences while in editor?(not playing)
    I'm making some kind of preview system and it would be nice as a designer to immediatly see tween changes...

    Best regards,

    G van Dijk
     
  9. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,228
    @Marco-Sperling Hi, and sorry. No, DOTween Pro paths don't support scaling or rotating (unless you set them as local and scale/rotate only after the path has been created at runtime and is being run). I added this info to the website. The path system is done to be very lightweight but also simple (since the Pro version doesn't focus only on that). But if you want something more complex (which uses actual gameObjects for waypoints, instead of just storing the data, and thus can be manipulated more extensively) I always recommend Simple Waypoint System by @Baroni : it uses DOTween's core in the background but is totally path-centric and very flexible.

    @gpvd Ahoy! Sorry but no. I tried various approaches, but none was really working considering DOTween's logic.
     
    Baroni likes this.
  10. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Posts:
    3,228
    @sbmhome Can you show me a screenshot of the Inspector and of how you restart it? Setting AutoKill to OFF and using DORestart should always do the trick.
     
  11. gpvd

    gpvd

    Joined:
    Nov 2, 2013
    Posts:
    76
    Ok, but thanks for the quick awnser!
     
  12. Sabrino

    Sabrino

    Joined:
    Aug 8, 2015
    Posts:
    21
    Hi Izitmee,

    I think there might be a bug with DOKill's default parameters. I am using DOShakeAnchorPos to shake a UI element, killing all tweens on it before starting it to make sure the starting position stays the same if used again before it is over:

    Code (CSharp):
    1. rectTrans.DOKill();
    2. rectTrans.DOShakeAnchorPos(0.5f, new Vector3(40, 40, 0), 20);
    Even if dokill should complete the tween by default, by doing this repeatedly before the last shake is over the UI element starting position will slide off in a random direction, proving that the dokill is not in fact completing the tween. If I explicitly set rectTrans.DOKill(true) everything works fine. Am I missing something?
     
  13. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    939
    I just picked up DoTween as well as bought the Playmaker Actions. I'm having trouble using 'Do Tween Transform Look At Game Object'. What Im trying to do is have the camera continuously look at a game object with a delay and an ease, every frame. Is there a better Playmaker Action to use?
     
  14. BrownBot

    BrownBot

    Joined:
    Feb 27, 2013
    Posts:
    2
    Hi Izitmee,

    Is it possible to use DOTween Pro Paths to move the RigidBody or RigidBody2D component of an object rather than the Transform?

    I have tested manually coding RigidBody2D.DOMove() and it works fine on my objects maintaining the physics simulation but my old waypoint system is crap so I'd like to use the nice smooth paths.

    Also is there a good reference anywhere for all different types of Ease's?

    Thanks for these great components.
     
  15. Dragonic89

    Dragonic89

    Joined:
    Jan 3, 2013
    Posts:
    48
    Can we be lazy as hell and set a variable with a tween at 0 second :p ?

    Found an old code of mine where I saw :

    Code (CSharp):
    1. mobj.transform.DOLocalMoveX( 10, 0 );
    2. mobj.transform.DOLocalMoveX( 35, 3 ).SetEase( Ease.InOutSine );
    Lazy as I am, I think I didn't want to write this >< :

    Code (CSharp):
    1. mobj.transform.localPosition = new Vector3( 10, mobj.transform.localPosition.y, mobj.transform.localPosition.z );
    2. mobj.transform.DOMoveX( 35, 3 ).SetEase( Ease.InOutSine );
    Or even didn't tried to create a shortcut >< !

    So just out of curiosity I was asking myself if DOTween use some optimized process when a Tween is defined with 0 second ^^ !
     
    Last edited: Oct 17, 2016
  16. samjoly

    samjoly

    Joined:
    Apr 23, 2013
    Posts:
    30
  17. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    399
  18. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    390
    Is there any way to specify in DO tween path how long a waypoint takes or to set specific rotations by waypoint? This things would be very useful to me. Currently it seems that I have to have one path on one game object then toggle another game object on and do another dotween path to have different speeds between two waypoints.
     
  19. sonofbryce

    sonofbryce

    Joined:
    May 19, 2009
    Posts:
    108
    Is there anyway to stop a DOVirtual.DelayedCall() ?

    Thanks!
     
  20. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    426
    Hi, I'm trying to use Dotween Pro to animate the alpha of a raw image component, but when I select color or fade I get the message "No component was found for the selected animation." Is it possible to animate raw images?
     
  21. woshihuo12

    woshihuo12

    Joined:
    Jul 18, 2014
    Posts:
    36
    someone help me?
     
  22. mmortall

    mmortall

    Joined:
    Dec 28, 2010
    Posts:
    81
    Hello. I need help with one issue in DOTween. I have some garbage generated by TweenerManager.
    This garbage generated in TweenerCore.Reset by Activator.CreateInstance()

    Is this intended? Is it possible to fix? I cannot find Activator.CreateInstance() function call in the DOTween source code at all.
    Thanks
     
  23. ChrisSmith

    ChrisSmith

    Joined:
    Nov 3, 2016
    Posts:
    1
    Just heard of DOTween today. Bought the Pro. Love it so far.

    Dumb question:

    Seems everything is either a TO or FROM. Is there a FROM TO option to always force a Tween between two values rather than having to pre-insure that the built in value is at a certain setting?

    example. This is what I'm doing now to make sure that a previous tween is killed and restarted as a fade from full alpha to zero alpha:

    Code (CSharp):
    1.      
    2.         glow.DOKill();
    3.         glow.setAlpha(1f);
    4.         glow.DOFade(0f, glowSpeed).SetEase(glowEase).SetRecyclable();
    (the .setAlpha() is from my own extension methods)

    Where it would be easier if I could just:

    Code (CSharp):
    1.  
    2.         glow.DOFade(1f, 0f, glowSpeed).SetEase(glowEase).SetRecyclable();
    where the first 2 params are a FROM and TO built in.
     
  24. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    399
    Hi @ChrisSmith

    You can chain a ChangeStartValue() or ChangeEndValue() or ChangeValues() to the Tween which is basically the same as your extension method.

    Code (CSharp):
    1. glow.DOFade(0f, glowSpeed).ChangeStartValue(1f).SetEase(glowEase).SetRecyclable();
    If you want to make sure a previous tween has completed you can send it to it's end position using

    Code (CSharp):
    1. glow.Complete(bool withCallbacks)
    And you can also use Restart() & PlayBackwards() if you need to switch between FROM and TO values.
     
    ChrisSmith likes this.
  25. dumblet

    dumblet

    Joined:
    Nov 4, 2016
    Posts:
    1
    Hi, i've been trying to use DORotate to rotate an object diagonally and have found no success. I keep on getting the gimbal lock. I tried using the one with quaternions but i cannot understand it.

    I'm trying to rotate a hexagonal tile at 45, 135, 225, 315 angles (for 4 different hex tiles).
     
  26. MisterMr

    MisterMr

    Joined:
    Jan 13, 2016
    Posts:
    1
    Help:
    I am using DoTween for pathfinding for an endless runner. The game involves floating down a river made up of many river pieces with waypoints that act as the waypoints for DoTween. A new piece is spawned when you get near the end of the current piece. I have tried two different approaches with DoTween to travel down the river smoothly, but they both have bugs that i cant figure out. I tried using .onComplete to switch to the new path on completion, but the new path has a tail that sticks out backwards from the first waypoint which causes the player to momentartily travel in the opposite direction. The other approach I tried was adding each new river piece as a sequence, but everytime I add a new path to the sequence, the character immediatly switches to the new path the moment it is added to the sequence without finishing the current tween. Any thoughts on what I might be doing wrong? Or possible solutions? Thanks!
     
  27. sergi-gil

    sergi-gil

    Joined:
    Oct 29, 2015
    Posts:
    9
    Hi!

    Yesterday I bought DoTween Pro and I'm starting using it... it's a great tool!!!

    From the other side, I plan to use this tool with visual UX/UI artists that want to setup the animations that I'm creating... the thing is at some point I have to create a battle intro sequence with a lot of animations that I think I can afford using sequence... the point is to know if you have plans to have like a visual sequence manager where the artists can tweak all the parameters for every animation, avoiding this way that I have to change a lot of things/times the sequence from code.

    A part from this, and thinking again in people touching values for animations, can we have a visual tween manager from where we can control all the animations in a scene for example, to avoid going to every gameobject to tweak values? at least a manager that have references to the animations in the scene to be easier to know what to touch?

    Thanks In advance!

    Sergi
     
  28. Hiltonaht

    Hiltonaht

    Joined:
    Nov 6, 2016
    Posts:
    1
    I think these functions would be pretty useful too. It will take time to make those managers tho. I think it would be great if we can have an animation script that does not need to be attached to the gameobject, but link to the gameobject remotely instead, so that we can manage the animations of different gameobjects at the same script.
     
  29. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    369
    Thanks...ill try that....I'm just seeing your reply as I haven't gotten any notications here...
     
  30. stereographik

    stereographik

    Joined:
    Sep 9, 2015
    Posts:
    3
    Hi everyone,
    I'm quiet stuck on tweening particles like :
    Code (CSharp):
    1. DOTween.To(() => m_Particles[i].position, x => m_Particles[i].position = x, new Vector3(10, 10, 10), 5);
    anyone succeded on this ? help would be much appreciated
     
  31. November

    November

    Joined:
    Oct 16, 2013
    Posts:
    7
    i want to move a gameobject by dopath,but i need move it from one position of path,not one index of path.how can i do?
     
  32. anjanj

    anjanj

    Joined:
    May 26, 2016
    Posts:
    1
    Looking for a way to modify the duration of a Tweener after it's passed back through a function. Seems like there's no way that's working for me. Even stopping it and starting it again would be fine because it'll happen almost instantaneously.

    This is where I want to modify the duration:
    Code (CSharp):
    1.  
    2.       transition = obj.panel.SetPosition(pos, true)
    3.             .SetEase(Ease.OutQuad)
    4.             .OnComplete(() => transition = null);
    5.  
    Tried something like
    Code (CSharp):
    1. transition.ChangeEndValue(transition.target,0.1f).Goto(0f,true);
    and Restart() and Stop(), Start() but still no joy. Any suggestions? Thanks!
     
  33. Azmar

    Azmar

    Joined:
    Feb 23, 2015
    Posts:
    246
    I just installed DOTween and I have a problem. I have a unity uGUI UI gameobject with it's anchor preset set to bottom middle. When I do:

    Code (CSharp):
    1. transform.DOLocalMove(new Vector3(0,100,0), 0.2f, true).SetEase(Ease.InOutQuad).SetLoops(0).SetDelay(0);
    It doesn't go to that position based on the anchor position, which I would like it to. It ignores it's anchor position and pretends it is still based on the default middle anchor setting.
     
  34. papakirk

    papakirk

    Joined:
    Nov 24, 2015
    Posts:
    1
    Hay all,

    I'm having a problem with DOTween in 2D mode. Everything sets up fine, but when I play the scene, the sprite GameObject has the transform rotation Y variable constantly set to 90. I tried presetting this to -90, but found out that this variable is repeatedly set to 90 and wipes out my preset value. The quick work around for this is , of course, create a GameObject "wrapper", or parent, and set my original GameObject (now the child of the wrapper) to -90. This works fine until I assign a Box Collider 2D to the wrapper. Since the wrapper is unexplainably being turned 90 degrees on the Y axis, so is the Box Collider 2D - which then turns it into an Edge Collider. This does not happen with the Circle Collider 2D, only the Box Collider 2D.

    What's happening here? Did I find a bug or am I doing something wrong?
     
  35. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    331
    Hi there

    In your docs page: "Delays and loops (when not infinite) will work even inside nested tweens."

    Is that why the inserted tween will only work once?
    Code (CSharp):
    1. _loadingScreen.Append(_thisRect.DOAnchorPosY(0f, 0.3f).SetEase(Ease.InCubic)).Insert(0f, _rectRotatingImage.DOLocalRotate(new Vector3(0f, 0f, 90f), 1f, RotateMode.Fast).SetEase(Ease.Linear).SetLoops(-1, LoopType.Incremental)
    2.         );
    Ideally, I'd like the inserted tween to occur non-stop:
    Code (CSharp):
    1. _rectRotatingImage.DOLocalRotate(new Vector3(0f, 0f, 90f), 1f, RotateMode.Fast).SetEase(Ease.Linear).SetLoops(-1, LoopType.Incremental);
    I also added a DO Tween Animation component to this image, but I was wondering what do you suggest?

    Thanks
    German
     
  36. LeGiangAnh

    LeGiangAnh

    Joined:
    Nov 10, 2013
    Posts:
    113
    Hi. We have a project using HOTween actions with Playmer and now we would like to upgrade it to DOTween. Is there any quick way to achieve that instead of replace the action in every FSM?
     
  37. GJSIII

    GJSIII

    Joined:
    Feb 27, 2016
    Posts:
    6
    Hi, I'm new to DOTween but am loving it, and have a quick question: using DOTween Pro's visual editor, how can I change the start value for a tween? For example, the player will trigger a collider and start a tween (DOTween.Play("tweenPath")), but it sends the player back to their original position when I need it to start at the player's current position.

    Thanks!
     
  38. iseta

    iseta

    Joined:
    May 5, 2016
    Posts:
    39
    Hello, I'm using iTween and Vuforia for an augmented reality project, everytime I press the build, to build the .apk, one of the objects in which I use the iTween starts giving me this error: ArgumentException: No tween with the name 'sobe' could be found on the GameObject named 'ponteiro'. And I've double checked it, there is the tween in the object, in fact, it works just fine BEFORE I build it, after it it just won't work anymore. Thanks!
     
  39. JakeTBear

    JakeTBear

    Joined:
    Feb 15, 2014
    Posts:
    123
    @iseta wrong forum, this is DOtweens forum, not Itweens
     
  40. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    920
    Hi there,
    How can i determine how much a tween has played/remaining like a progress.

    Something like

    DoRotate().onUpdate(status);

    void status(float currentProgress){

    //from 0 to 1

    }

    Thanks
     
  41. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    399
    If you store a reference to the tween you could use Elapsed() or ElapsedPercentage()

    Here's the link to the relevant section of the docs
    http://dotween.demigiant.com/documentation.php#gettingData
     
    jGate99 likes this.
  42. LeGiangAnh

    LeGiangAnh

    Joined:
    Nov 10, 2013
    Posts:
    113
    Any one can help me on this?
     
  43. DamianBaltoro

    DamianBaltoro

    Joined:
    Dec 8, 2016
    Posts:
    1
    Hello!
    I have some strange bug...when first tween is playing, animation lose about half of it's frame (like something has to move from 0 to 100 and in my case i see only from 50 to 100)..this happens only on mobile build and only on first tween in game, in editor everything is working 100% good. Does anyone has similar problem?
     
  44. gregmax17

    gregmax17

    Joined:
    Jan 23, 2011
    Posts:
    183
    Hello! I'm having trouble with my player moving through walls when I call the DOJump or DOMove on the player object. I'm calling the DOJump and DOMove methods on the players rigid body itself, but this doesn't seem to help.

    Is there something else I need to be doing?
     
  45. Mr-Logan

    Mr-Logan

    Joined:
    Apr 13, 2006
    Posts:
    455
    I've been googling around trying to find an answer for this, but with no luck.

    I'm trying to set up a path for a GameObject to move along. While moving I want the GO to also face in the direction that it's moving, however I really can't figure out how this is done. According to the manual the SetLookAt should be used, but I can't figure out how to get the players position on the path.
    I figured that I need to call SetLookAt with the path percentage, but with no way of reading it, that just doesn't seem doable..


    Also, is it possibly to somehow move the GO along the path based on speed rather than on time?
    Thanks =)
     
  46. ExcellencyHong

    ExcellencyHong

    Joined:
    Aug 9, 2016
    Posts:
    17
    i think, maybe "DoTween.Sequence()" has some bug. i try to get a Sequence in different object via same script, and then just one object which last call DoTween.Sequence() is worked.
    perhaps, each objects cannot call one another sequence. it seem to be share one sequence.
     
  47. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    399
    Is this the problem you are having? (from the documentation)

    If you are trying to use a cached Tween/Sequence within multiple other Sequences, then you need to create unique versions of it for use in each sequence.
     
  48. Mr-Logan

    Mr-Logan

    Joined:
    Apr 13, 2006
    Posts:
    455
    Ah, I figured out there was a ."SetSpeedBased" option, which fixed the first question. I'm still not certain how to handle the look direction though.
     
  49. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    399
    Do you mean you want the GO to rotate along the contours of the path, or are you talking about flipping it depending on whether it's moving towards left/right of the screen?
     
  50. Mr-Logan

    Mr-Logan

    Joined:
    Apr 13, 2006
    Posts:
    455
    Yeah, I just figured that out too though.

    Save the pathing as a sequence, and then set to the SetLookAt to look at "sequence.fullPosition". Not the most obviouse of solutions I might say, and it wasn't mentioned on neither the documentation or anywhere according to google. But at least it works. :)

    EDIT
    Oh and yeah, I meant rotating to look in the direction it's moving along the path.
     
    Last edited: Dec 27, 2016