I am trying to get my game so if you walk up to a sprite and stand next to it then press space you can talk to it. My code doesnt continuously check after a collision how would i get it to do so.
void OnTriggerEnter2D(Collider2D Talk)
{
if (Talk.gameObject.CompareTag("Player") && Input.GetKeyDown("space"))
{
Debug.Log("HI");
}
}