unity 2d press key on trigger stay 2d code example
Example: unity while in trigger
void OnTriggerStay(Collider other)
{
Debug.Log("This will be called every frame");
if (Input.GetKeyDown("space") && other.tag == "TalkCylinder")
{
Debug.Log("Talking");
}
}