2D or 3D? Camera Rotation, 3D Cube move problem, local or global position?

Hi guys! There is something wrong with my main game. First question: choose 2D or 3D? My goal is like 《Project Zomboid》( one of my favorite games)I create 2D project, create a 3D GameObject Cube. Using the default camera. I write a roleMove C# script. I play the game it work Cube move. I change the camera’s rotation to make a 2.5D view vision. The I play the game when Cube move it stucks. Like bug. Like Ghost Animal video hyperspasmia dancing. I think perhaps there is something wrong with roleMove scrip’s location? local or global? I need your suggestion or comments.
Here is my roleMove script:

void Update()
{
    mouseMove();   
}
void mouseMove()
{
    if (Input.GetMouseButtonDown(1))
    {
        targetPos = Input.mousePosition;
        targetPos.z = 0;
        mainCamera = Camera.main;
        Vector3 worldPos = mainCamera.ScreenToWorldPoint(new Vector3(targetPos.x, targetPos.y, 16.0f));
        transform.position = new Vector3(worldPos.x, worldPos.y, transform.position.z);
    }
}

GIF: same 2D project same scene Cube move stucks bug
2pot5DMoveStucks