- Home /
Question by
HikerJB · Dec 03, 2013 at 05:31 AM ·
changeitweenfollow pathpaths
PutOnPath is not working for changing paths.
I have a hiking game that is working well using iTween paths. However, I can't seem to get it to switch paths at an intersection. The controller just sits at the end of the path. I've been working on this for months. What's wrong?
function ChangePath() {
if (currentPath == controlPath ) {
if ((pathPosition > 0 ) && (pathPosition < .05) && (characterDirection=="reverse") ) {
if (Input.GetKey("f")) {
iTween.PutOnPath(character,eastWest, 0);
currentPath = eastWest;
pathName = "eastWest" ;
speed = .001;
pathChoice = 0;
Debug.Log ("You're on eastWest. Speed = " + speed + " position = " + pathPosition);
}
else {
iTween.PutOnPath(character, eastCoast, 0);
characterDirection = "forward";
currentPath = eastCoast;
pathName = "eastCoast" ;
speed = .001;
pathChoice = 0;
Debug.Log ("You're on eastCoast. Speed = " + speed + " position = " + pathPosition);
}
}
Comment
Your answer
Follow this Question
Related Questions
ITween and Unity Postions. 1 Answer
Camera always 90 degrees to player (curved path) 1 Answer
iTween Path changing 0 Answers
iTween Path Controlled 1 Answer
Path constrained characters. 1 Answer