Unity has some InputSystem for Character Movement. you want to walk on a 2D plane, so I recommend you following movement:
Try to use the GetAxis.y-Type. You can look for it in the scripting-Documentation in Unity or in one of those endless youtube-vids^^
I think this is the right type. I dunno, I havent worked so much on the UnityInputSystem, but I've worked on some FPS-Controller, and this System was very useful. You can make it like this:
You get the axis you want the character to move, then place the trigger permanent on the axis. (i.e. like you pressed the 'd'-button permanently on the keyboard if you want to go to the right^^). Then, you can add some mechanics to achieve some boost over time by adding Time.deltaTime to the Speed-Value. So you make this like this (script provided)
Maybe its not so efficient, especially its written in the Update-function, but you can build upon this and look what works better for you^^ To build the gravity-mechanic, you can put a trigger on the spacebar or so.
You can achieve this with the "Input.GetButtonDown(KeyCode.Space)"-method.
I hove I could help you^^
private float speed; private void Update() { float charMove = Input.GetAxis("Horizontal") * speed; //or vertical, you'll have to try it out. This gives you the Axis to move. float charBoost = charMove * Time.deltaTime; //to give the Character the Boost over Time. transform.Translate(charBoost, 0f, 0f); //The Movement-Magic^^ }