- Home /
Question by
Mannfred · Apr 04, 2013 at 08:35 AM ·
triggeritweenpath
ITweenPath Trigger
In my scene I have a truck that moves on a path using ITweenPath. at the moment it is in the function Start(); .. My question is how do I make the ITweenPath Start even the player enter a trigger? Is it even possible to start an ITweenPath on a trigger? I dont know how the script it in Java. Please Help.
Here is the Code so far:
using UnityEngine;
using System.Collections;
public class truckmove1 : MonoBehaviour {
// Use this for initialization
void Start () {
StartCoroutine (DoStuff());
}
// Update is called once per frame
private IEnumerator DoStuff() {
yield return new WaitForSeconds(30);
iTween.MoveTo(gameObject,iTween.Hash("path",iTweenPath.GetPath("truckpath1"), "time", 5, "easetype", iTween.EaseType.linear, "Speed", 10, "orientToPath", true));
}
}
Comment