Rotating Towards GameObject Location

I’m trying to have my player model rotate towards the chosen position and face the destination… However, it only seems to happen the first time…

public void MovePlayer(GameObject location)
    {
        if (mainGame.turnPlayer.actionPoints == 0)
        {
            MessageList.Instance.AddMessage("Not Enough Action Points!");
        }
        else
        {
            Vector3 toFace = new Vector3(0f, location.transform.position.y, 0f);
            playerModel.transform.rotation = Quaternion.LookRotation(toFace);

            playerLoc = location;
            playerBehaviour.moveRange.Clear();
            MessageList.Instance.AddMessage("Player Moved...");
            mainGame.turnPlayer.actionPoints -= 1;
        }
       
    }

I’m sure I’m missing something simple but I’m just sat here scratching my head over it…
Thank you in advance!

With out the complete script I don’t know if we can see the issue. the looks ok, and like you said, it does it once.
Explain to us when MovePlayer() gets called.

So here is where the method is called…

void OnMouseDown()
    {
        if (gameManager.gameState == "idle")
        {
            if (GetComponent<MeshCollider>().bounds.Intersects(gameManager.distanceCol.bounds))
            {
                gameManager.MovePlayer(gameObject);
            }
            else
            {
                MessageList.Instance.AddMessage("Too Far Away!");
            }
        }
    }

Check your toFace vector. LookRotation expects the direction you wish your forward vector to be aligned with: it should be something like this:

toFace = (lookAtPoint - transform.position).normalized;

on line 7, what gameObject is passed in? it looks like you’re sending in the same object. unless this script in on multiple objects.

Sorry, I should have explained. The OnMouseDown() is on another script.

This worked perfectly! Thank you to you both for your help.