Arc movement
« on: April 25, 2015, 04:32:26 PM »
Hi,

I wanted to know if it is possible to move something in an arc movement?

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Arc movement
« Reply #1 on: April 26, 2015, 01:10:01 PM »
Hi,

To achieve an arc movement you could either tween the X and Y of your transform with different eases:
Code: [Select]
myTransform.DOMoveX(3, 2).SetEase(Ease.OutQuad);
myTransform.DOMoveY(3, 2).SetEase(Ease.InQuad);

Or you could use blendable tweens (which are special types of tweens that can interact with each other), and move your target's X axis with one, while moving the Y's axis with another in a Yoyo loop:
Code: [Select]
myTransform.DOBlendableMoveBy(new Vector3(3,0,0), 2);
myTransform.DOBlendableMoveBy(new Vector3(0,3,0), 1).SetLoops(2, LoopType.Yoyo);