How to make the player run continuously after clicking a button

So I’m new to unity and made a game by watching YouTube tutorials and my sprite runs horizontally by using the left, right keys and jumps while holding down spacebar.

But I want the player to move continuously after clicking the a button and then jump using the spacebar. Similar to how the offline chrome dinosaur game works. Only thing the player does is jump and it moves continuously after clicking spacebar.

The c# code is attached, please help me out

// paste code here

screenshot of a text editor

it’s very simple, just make a bool isMoving and set it to true the first time you press the button, if it’s true the player will just move without an input value, set it to false when the player dies, very simple