Search Unity

Question How can I use DoTween to get Arc like move

Discussion in 'Editor & General Support' started by mfatihbarut, Nov 19, 2022.

  1. mfatihbarut

    mfatihbarut

    Joined:
    Apr 11, 2018
    Posts:
    1,060
    Hi all,
    How can I use DoTween to get Arc-like move?
    For example to beautify collecting coins, instead of line move how can I collect coins with arc like move
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,747
    If I had to imagine how to pull off what you're saying, it would be two simultaneous tweens.

    - 1 tween to move the overall base invisible GameObject from A to B in a straight line, perhaps with easing.

    - another tween to move the local position of the child (where the visible coin is located) sideways to the straight line (90 degree rotation), during the same time interval, at TWICE the rate, so it goes out to the side and back in again by the time the main tween finishes.

    Hierarchy would look like:

    InvisibleGameObject <- master tween here
    VisibleCoinOjbect <- sub tween here
     
  3. mfatihbarut

    mfatihbarut

    Joined:
    Apr 11, 2018
    Posts:
    1,060
    thanks a lot and I think you say I should use "Join" in sequence.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,747
    I don't know anything about "Join" and I didn't say anything about "Join." (see above post)

    I said start two tweens simultaneously on the two different GameObjects.