as a title, i want a move my character, based on recorded move on another script,
so there is a Move.cs for record the move and Character.cs for moving the character.
but i dont understand how to move character. and what step should i do to make it works.
here is some example :

some of my Move.cs
public class Move : MonoBehaviour {
private string[] allMoves;
private bool empty;
private int totalMoves;
private int i=0;
public string firstMove; // this first Move the one
// Use this for initialization
void Start()
{
totalMoves = Object.Length; // this Object reference from other script object, so ignore it
allMoves = new string[totalMoves];
}
public void UpMoves()
{
AddMoves("up");
}
public void BotMoves()
{
AddMoves("bot");
}
public void LeftMoves()
{
AddMoves("left");
}
public void RightMoves()
{
AddMoves("right");
}
void AddMoves(string move)
{
if (empty) {
firstMove = move;
empty = false;
}
else
{
if (i < totalMoves)
{
allMoves[i] = move;
i++;
}
}
}
public void NextMove()
{
string temp;
firstMove = allMoves[0];
for (int a = 0; a< totalMoves; a++){
temp = allMoves[a + 1];
allMoves[a] = temp;
}
}
}
and how my character could move a tile by tile by those recoded move?
i reference this code from another thread, have been modifed but i know it wont work
Character.cs
{
public float speed = 2.5f;
bool canMove;
Move move;
string movement;
Vector3 pos;
Transform tr;
void Start()
{
move = FindObjectOfType<Move>();
movement = move.firstMove;
bool canMove = true;
}
void Go()
{
if (move == "up")
{
transform.Translate(Vector3.up * speed * Time.deltaTime);
}
if (move == "left")
{
transform.Translate(Vector3.left * speed * Time.deltaTime);
}
if (move == "down")
{
transform.Translate(Vector3.down * speed * Time.deltaTime);
}
if (move == "right")
{
transform.Translate(Vector3.right * speed * Time.deltaTime);
}
}
void FixedUpdate()
{
if (canMove = true)
{
Go();
}
}
}