-
-
Save AlexMeesters/41e9cc26e71dcc2c105f75a6e7545da6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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