using UnityEngine;
using DG.Tweening;
public class TweenPositionExample : MonoBehaviour
{
public GameObject targetObject;
public float duration = 5f;
public float checkTime = 2f;
void Start()
{
// Create a tween to move the targetObject to a new position over the duration
targetObject.transform.DOMove(new Vector3(10, 0, 0), duration);
// Use DOVirtual.DelayedCall to get the position at checkTime
DOVirtual.DelayedCall(checkTime, () =>
{
Vector3 positionAtTime = targetObject.transform.position;
Debug.Log("Position at time " + checkTime + ": " + positionAtTime);
});
}
}