iTween, moving to a node on a path.

I’m making a board game and I decided to try and use iTween for the pathing around the board. I have 42 tiles around my board, each with it’s own node. I can get the gameObject to go completely around the path, but I’m lost at how to get it to only move to the node I need it to. I’m using a dice in the game to deiced how many spots the gameObject is to move if that makes a difference.

Would really appreciate any help, an example of a scenario would be if the game object was on node 3 and rolled a 6 it would go to node 9.

Note: I’m writing this in javascript.

I should have read the question more carefully since you say “each with it’s own node.” Anyway, if you can move around the whole path, somewhere you have an array of either Vector3s or Transforms that you pass to iTween. Since you have a singe ordered path you can extract any part of it to build a list of Vector3s to pass to iTween. Note you should label your positions starting with 0. I’m using arv3AllPos as a list the list for the whole path. You array will have a different name. MakePath extracts any specified segment out of the total array to use as the path for a player move on the roll of the dice.

var arv3AllPos : Vector3[];

function MakePath(startNode : int, endNode : int) : Vector3[] {

	var v3New = new Vector3[endNode - startNode + 1];
	for (var i = startNode; i <= endNode; i++)
		v3New[i-startNode] = arv3AllPos*;*
  • return v3New;*