Several ways you can do it.. heres one.
use TRIGGER EVENT to determine if things are touching (after you add rigidbody colliders). If they are, use a boolean called isTouching to store the info.
Now onto your motion controller button. You can have it when the button is pressed, it first uses GET FSM BOOL, to target the object that has the trigger events on it. Then if the boolean isTouching is true, perform the action you want, if isTouching is false, perform action.