using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using PathCreation;
public class path2 : MonoBehaviour
{
public PathCreator pathCreator;
public float speed = 5;
float distanceTravelled;
void Update()
{
distanceTravelled += speed * Time.deltaTime;
transform.rotation = pathCreator.path.GetRotationAtDistance(distanceTravelled);
transform.position = pathCreator.path.GetPointAtDistance(distanceTravelled);
}
}