Hey I have recently created a simple a* pathfind script for my game. The Astar works fine. it returns the right path and everything. the problem I am haveing is whn I want to translate the players position from node to node. I have tried Vector3.Lerp and also the MoveObject script from the wiki. The both translate but it goes from the start to end without hitting the other nodes.
// Search for shortest path
AStar.GetInstance().Search( currentPos, hexPosition );
// If path found move player
if( AStar.GetInstance().IsPathFound() == true )
{
// Get the path and flip it
var newPath = AStar.GetInstance().GetPath();
newPath.Reverse();
for( index = 0; index < newPath.length; ++index )
{
currentPlayer.transform.position = Vector3.Slerp(currentPlayer.transform.position, newPath[ index ].transform.position, 10 );
//MoveObject.GetInstance().Translation( currentPlayer.transform , currentPlayer.transform.position, newPath[ i ].transform.position, 10, 1 );
}
}
else
{
print( " Path not found" );
}