I write some script for itween waypoint.
I want to the cube make the circle Unlimited
How to write the script?
WaypointMove.js (attach cube)
using UnityEngine;
using System.Collections;
public class WaypointMove : MonoBehaviour {
public Transform[] waypoints;
public float m_speed;
void Start(){
MoveToWaypoint();
}
void OnDrawGizmos(){
iTween.DrawPath(waypoints);
}
void MoveToWaypoint(){
iTween.MoveTo(gameObject,iTween.Hash("path",waypoints,"speed",m_speed,"easetype","linear"));
}
}
my project