public void OnTriggerEnter(Collider other) { if (other.tag == "PlayerInteractable" || other.tag == "HittableObject") { PlayerInteractable interactable = other.GetComponent <PlayerInteractable>(); if (interactable.affectsEnemy) { interactable.Interact(this.moveableObject); } } }
public void OnTriggerEnter(Collider other) { if (!canMove) { return; } if (other.tag == "PlayerInteractable" || other.tag == "HittableObject") { PlayerInteractable interactable = other.GetComponent <PlayerInteractable>(); interactable.Interact(this.moveableObject); } }