Find iTween path nodes position

i have a path for player to move ..... along with two cameras follow him sidewise and a particular time that side cam disabled and back cam enabled and follow tha player both cam's have separate itween path.........i need last nodes value to enable other cams...... how can i get it......

i have the following script

using UnityEngine; using System.Collections; using System.Collections.Generic;

public class PlayerWalkFollow1 : MonoBehaviour { public GameObject PlayerFollowCam1; public GameObject FirstPersonCam; public GameObject Player;

void Start () {
    //if(Time.time >=5) {
        //PlayerFollowCam1.active = true;
        FirstPersonCam.SetActiveRecursively(false);
        iTween.MoveTo(gameObject, iTween.Hash("path" , iTweenPath.GetPath("PlayerWalkFollowCam1"), "time" , 29, "easeType", iTween.EaseType.easeInOutSine));
    //}
}
/*void OnEnable () {
    timing1 = 16.0f;
}*/

void Update () {

    iTweenPath other = PlayerFollowCam1.GetComponent<iTweenPath>();
   // other.pathName = "PlayerWalkFollowCam1";
   // other.nodeCount = 6;

    if(other.pathName == "PlayerWalkFollowCam1" && other.nodeCount == 6) {
        FirstPersonCam.SetActiveRecursively(true);
        PlayerFollowCam1.active = false;
        Player.SetActiveRecursively(false);
    }       
}

}

3 Answers

3

other.nodes*.z

* *

i - which node .z - z axis

*

iTweenPath other = BackCamPath.GetComponent

                 <iTweenPath>();

        float nodeVal = other.nodes[5].z;
         other.pathName = "PlayerWalkFollowCam1";

BackCamPath - the game object which have iTweenPath script for creating path

give OnComplete function in iTween script we wrote

void Start () {

   iTween.MoveTo(gameObject, iTween.Hash("path" , iTweenPath.GetPath("PlayerWalkFollowCam1"), "time" , 17, "easeType", iTween.EaseType.easeInOutSine, "OnComplete", "Next1"));

void Next1 () { //do the stuff u want }