The above setup should work for you. You can create a variable inside your desired blueprint and just use the code I’ve provided above. Try adding it after you have performed a Key check, when true add to your variable, then perform another check if it has reached value you desire.
In your example you are setting the collision but earlier you mentioned you want to set gravity. This is a bit confusing to me, maybe you can clarify. I mean what is the concept here, try to dumb it down as much as you can.
I think you should try, if possible, moving the code to your character. Whenever I watch a tutorial people always say you shouldn’t use tick event is you don’t have to. Checking every frame if F was pressed doesn’t seem like a good idea, you only want to run this when you actually do something.
If I’m wrong about this please correct me.