Skip to content

Instantly share code, notes, and snippets.

@AlexMeesters
Created June 30, 2019 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexMeesters/41e9cc26e71dcc2c105f75a6e7545da6 to your computer and use it in GitHub Desktop.
Save AlexMeesters/41e9cc26e71dcc2c105f75a6e7545da6 to your computer and use it in GitHub Desktop.
using DG.Tweening;
using UnityEngine;
public class DoTweenLerpExample : MonoBehaviour
{
[SerializeField] private Vector3 pointA = new Vector3(-2, 0, 0);
[SerializeField] private Vector3 pointB = new Vector3(2, 0, 0);
[SerializeField] private float speed = 1;
private void Start()
{
transform.position = pointA;
Tweener tweener = transform.DOMove(pointB, speed);
tweener.SetEase(Ease.InOutQuad);
tweener.SetLoops(int.MaxValue, LoopType.Yoyo);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment