[2D Isometric] Problems while programming objects to move into a mesh.

Hello everyone.
I’m doing a school project with one mate, and we’d a bunch of problems because neither our teacher, or us, touched Unity. We are trying to make a strategic RPG turn-based game based on Final Fantasy Tactics and such.

My mate downloaded a 3rd-party software called Tiled & Tiled2Unity and managed to do a simple 2D isometric map (8x8). The problem we have now is that we try to put an object (the player’s character) and make him move at the map, but we don’t know how to do it. When we import the map, it generates a mesh.

We tried to move the object via changing X and Y. This makes the characters move (static and “teleporting”, but moves), but for obvious reasons, it can make go off of the map, so we need also to know how to make it to recognize if there’s someone at some tile, or if the tile is the limit of the map, or an obstacle (like a house).

Thanks in advance!

Also, due to some restrictions, we’re doing this in Unity 5.0.0

One way to do Isometric which may make your life easier, would be to use regular non-isometric art, with an orthographic camera setup to be at an isometric angle.

If that’s not to your taste, then you’ll need to manage all your movements as diagonal position shifts (which you may well already be prepared to do).

To keep your player from instantly moving when setting position, you can either interpolate your movement in an Update function, or use a third party tweening kit like DOTween.

A simple movement interpolation:
Time based:

    public float moveDuration;
    private Vector3 targetPosition;
    private Vector3 initialPosition;
    private float elapsedTime;
    private bool canMove;

    public void MoveTo(Vector2 position) {
        initialPosition = transform.position;
        targetPosition = position;
        elapsedTime = 0;
        canMove = true;
    }

    private void Update() {
        if(canMove) {
            if(transform.position != targetPosition) {
                transform.position = Vector3.Lerp(initialPosition, targetPosition, (elapsedTime / moveDuration));
                elapsedTime += Time.deltaTime;
            } else {
                elapsedTime = 0;
                canMove = false;
            }
        }
    }

Speed based:

    public float moveSpeed;
    private Vector3 targetPosition;
    private float elapsedTime;
    private bool canMove;

    public void MoveTo(Vector2 position) {
        targetPosition = position;
        canMove = true;
    }

    private void Update() {
        if(canMove) {
            if(transform.position != targetPosition) {
                transform.position = Vector3.MoveTowards(transform.position, targetPosition, moveSpeed);
            } else {
                canMove = false;
            }
        }
    }