setTrigger() for another GameObject doesn't work

I have a Game Controller on a Game Controller object and I want to setTrigger(); on the players (another object) animator to trigger his animation.
This doesn’t work. The following is my code:

public class buttonSwap : MonoBehaviour
{
    [SerializeField]
    private GameObject player;
    private Animator playerAnim;
 
 
    private void Awake()
    {
        playerAnim = player.GetComponent<Animator>();
    }
 
    // Start is called before the first frame update
    void Start()
    {
        playerAnim.SetTrigger("keyPressShape");
    }
 
    // Update is called once per frame
    void Update()
    {
        if (Input.GetButtonDown("Fire1"))
        {
            playerAnim.SetTrigger("keyPressShape");
        }
    }

You need to check that the trigger is spelt correctly in the Animation Controller and that a transition is set to use the correct trigger. Have it open during play mode to see if it transitions to the next node.