Creating Fallout 1 Style Turn Based System In 3D

So I want to create a turn based system similar to Fallout 1 but in 3D. I’ve started with the movement script and I kept it as simple as possible. It creates a plane that the square follows based on mouseposition. On mouse click the gameobject moves to the where the square was last clicked and cannot be clicked again till the gameobject has finished moving. The script seems pretty solid. Does anyone have any suggestions for improvements or something I missed that would simplify some of the processes?

using UnityEngine;
using System.Collections;

public class SquareMovement : MonoBehaviour {
   
    public float speed = 10;
    private Vector3 targetPos;
    public bool isMoving;
    public GameObject square;
    public Vector3 squarePos;
   
    void Update ()
    {
        if(squarePos == Vector3.zero){
            if(Input.GetMouseButtonDown(0)){
                squarePos = square.transform.position;
            }
        }
        Plane plane = new Plane(Vector3.up, square.transform.position);
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        float point = 0f;
       
        if(plane.Raycast (ray, out point)){
            targetPos = new Vector3(Mathf.Round(ray.GetPoint(point).x),Mathf.Round(ray.GetPoint(point).y),Mathf.Round(ray.GetPoint(point).z));
            square.transform.position = Vector3.MoveTowards(square.transform.position, targetPos, speed);
            if(squarePos != Vector3.zero){
                transform.position = Vector3.MoveTowards(transform.position, squarePos, speed * Time.deltaTime);
                if(transform.position == squarePos){
                    squarePos = Vector3.zero;
                }
            }
        }
    }
}

what is “square” in this… ?

edit:
tbh, the logic flow feels messy. You’re performing raycasts every frame when you only need them when the user clicks, I think you’re trying to track where the mouse was in the last frame with square/squarepos and then using that at the start of the next frame if the user clicks.

I’d probably go with something with a little more cleanly structured

// no target
if(targetPos == Vector3.zero)
{
    if(Input.GetMouseButton(0))
    {
        Plane plane = new Plane(Vector3.up, square.transform.position);
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
      
        if(plane.Raycast (ray, out point))
        {
            targetPos = new Vector3(Mathf.Round(ray.GetPoint(point).x),Mathf.Round(ray.GetPoint(point).y),Mathf.Round(ray.GetPoint(point).z));
        }
    }
}
// have target
else
{
    // move towards target
    transform.position = Vector3.MoveTowards(transform.position, targetPos, speed * Time.deltaTime);
    // check if we're there, floating point based vectors really should be directly compared
    if(Vector3.Distance(transform.position, targetPos) < 0.01f)
    {
        // make things exact
        transform.position = targetPos;
        // clear the target
        targetPos = Vector3.zero;
    }
}

The square is purely for visual input. It’s difficult to tell where your character would end up otherwise and I can’t think of any other visual shorthand.