How to set velocity of MyCharacter in upwards direction and stop at current position when their is input press and again set velocity?

I want to program my character like that when the game starts the character should move in upward direction continously and when the player inputtouch the character should stop where it is and on released inputtouch it should again have velocity in upward direction. Using Blueprints. I have tried many ways but it didnt work.

add a boolean before you set the Location of your Player.
Have it true by Default and let the character Position update if the boolean is true.
Than you want to set the Boolean to false every time an input Event on press is fired.
Than when the Event “release” fires, you want to set the boolian back to true and your Player will continue to move upwards.
This is not the perfet method, for the best solution look into Keyword: Array
This should get you going until you figure out better Solutions.

So you can look for any key in your Blueprint and get an Event for that key. It had a pressed and released state. If you are looking to be professional, you want to create the inputs in Project Settings->Inputs, than call than input in your blueprint, same with the keyboard keys, but these events can have multiple triggers and are for one functions: for example Event shoot can be triggered by left mouse button and enter. You have to det up the inouts in the projects settings for yourself as mentioned above. To ensure your character gets, make sure that the character blueprint is a pawn, or a child class of pawn, for example: Character. You can see the blueprints class in the Blueprint editor Class settings tab. Also make sure that the default player pawn in the project settings is set to your character Blueprint, else you will not receive inputs. This should fix any issue with not receiving inputs on your character.

thank you. I tried but, the InputAction Event is not working. Can you tell me how to use InputAction Event properly?