How to update Target Position in DOMoveY if during moving target position changed, Like I'm running that function with duration of 1f and if within that 1f target position changed how can I update in DOMoveY? Here is code
for (int col = 0; col < gridColumns; col++)
{
for (int row = 0; row < gridRows; row++)
{
if (gridPositions[row, col].tag == "empty")
{
int c_row = (row + 1) > 6 ? 6 : (row + 1);
if (gridPositions[c_row, col].tag != "empty")
{
if (c_row < 6)
{
gridPositions[row + 1, col].transform.DOMoveY(EmptyBlocks[row, col].transform.position.y, 1f, false);
gridPositions[row, col] = gridPositions[row + 1, col];
}
}
}
}
}
You can achieve this by combining
OnUpdateandChangeEndValuefunctions. Inside ChangeEndValue function, you need to pass the required Vector3 that can change/update.