Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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.SetLoops(int.MaxValue, LoopType.Yoyo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment