Help with this blueprint

I’m really new to this unreal engine but basically, i want to attach my character to an object(cube) when i press E and detach when E is released.The logic i tought would be something like :

If character is colliding with block{

  if(E is being pressed) attach block to actor;

  if(E was released) detach block from actor;

}

But i don’t know how to implement it on UE4; what i’m doing right now is this:

Why would this not work?(and yeah, i know it’s not what i tought i had to do)
Also, i cant seem to find a condition that says isButtonPressed or isButtonReleased to do it with a branch, which is my main problem(if the attach is correctly done, of course).

The attachment doesn’t seem to work. You can add an event when you press the Button “E”, then find a reference to the block, and attach it to the actor.

To add the event for the “E” Button, right click in your actor blueprint (character,controller etc) and search for “E”.