private void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Npc") && other.GetComponent<DialogueTrigger>().hasBeenTalkedTo == false)
{
myRigidBody.isKinematic = true;
myRigidBody.velocity = Vector2.zero;
insideDialogue = true;
other.GetComponent<DialogueTrigger>().TriggerDialogue();
other.GetComponent<DialogueTrigger>().hasBeenTalkedTo = true;
}
}
idk if this need optimization or not, cuz idk if getting the same component multiple times when entering a trigger is taxing on performance or not