void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("interObject")) { currentInterObj = other.gameObject; currentInterObjScript = currentInterObj.GetComponent <interactionObject>(); } }
private void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("interObject")) { Debug.Log(other.name); currentInterObj = other.gameObject; currentInterObjectScript = currentInterObj.GetComponent <interactionObject> (); } }
void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("interactableObject")) { Debug.Log(other.name); //Check if walking into an object triggers debug code in console currentInteractableObject = other.gameObject; currentInteractionObjScript = currentInteractableObject.GetComponent <interactionObject>(); } }