Use this script after pressing a number from keyboard

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AgentScript : MonoBehaviour {

public Transform target;
    UnityEngine.AI.NavMeshAgent agent;

void Start () {
    agent = GetComponent<UnityEngine.AI.NavMeshAgent>();
}
void Update () {
    agent.SetDestination(target.position);	
}

}

Hello guys, i have this script and when i press play my FPSController goes to the predetermined position. I want this to be off and when i press number 1 for example from the keyboard i want the script to activate. Thanks in advance!

@FeelTheShotGG Alright i think i get what you mean basically you want to only have it do the set destination when you press number 1 for instance on keyboard but if u don’t then do move here is how to do this below.

Alpha1 = 1 on keyboard

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AgentScript : MonoBehaviour
{

    public Transform target;
    UnityEngine.AI.NavMeshAgent agent;

    void Start()
    {
        agent = GetComponent<UnityEngine.AI.NavMeshAgent>();
    }
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            agent.SetDestination(target.position);
        }
    }
}