- Home /
iTween nodes bug PLEASE HELP!
Hello human beings!
Im trying to generate more nodes and assign them to my players current position using iTween. But i have a bug that the nodes arn't being added/created and assigned if the iTweenPath object is not being viewed in the inspector during run time!
Please help me because it's really important for my game for it to work.
CODE (IDK if even needed):
//Happens every 0.25 seconds.
if(timePassed != 0){
walkingPath.nodeCount = (int)(timePassed / recordingDistance) + 1;
walkingPath.nodes [walkingPath.nodeCount - 1] = player.transform.position;
}
timePassed += recordingDistance;
Thank you for every help you can give. Ethan
Answer by eitanwass · Sep 03, 2016 at 12:45 PM
For everyone who will get this error:
There is an iTweenPathEditor script in which it changes the length of the list based on the nodeCount. You should copy the for loop from that script to where you change the nodeCount.
if(walkingPath.nodeCount > walkingPath.nodes.Count){
for (int i = 0; i < walkingPath.nodeCount - walkingPath.nodes.Count; i++) {
walkingPath.nodes.Add(Vector3.zero);
}
}
Like so
Your answer
Follow this Question
Related Questions
Analytics method to track player path in a 2d platformer? 1 Answer
Bug with EtceteraGUIManager.cs . 1 Answer
Dynamically Add Points to Spline 1 Answer
GooglePlayGames plugin path not correct? 0 Answers
Get current node in itween path 0 Answers