As title says. I figured out a way to make the animation of moving from one block to another possible. I will share my code on the bottom and screen cap of my result.
Here is the test on a single run:
Here is the test on multiple run:
I got the idea from this YouTube video:
void Start()
{
StartCoroutine(FollowPath());
}
IEnumerator FollowPath()
{
foreach (Waypoint Waypoint in path)
{
float timePercentage = 0f;
Vector3 startPos = transform.position;
while (timePercentage < 1)
{
timePercentage += Time.deltaTime / 1f;
transform.position = Vector3.Lerp(startPos, Waypoint.transform.position, timePercentage);
yield return null;
}
}
}
If there is a reason not to use this or a better way to do this, Please share down below.
Also thanks Ben and Rick for making all this possible for me!