Enemy Is not moving

In my 2D pixel RPG, I have a slime enemy that i am currently just trying to get it to move in random directions. For some reason, it is not moving at all. if you can help me fix this problem i would appreciate it greatly.

Here is my code:

public float moveSpeed;

private Rigidbody2D myRigidbody;

private bool moving;

public float timeBetweenMove;

private float timeBetweenMoveCounter;

public float timeToMove;

private float timeToMoveCounter;

private Vector3 moveDirection;

// Start is called before the first frame update
void Start() {

    myRigidbody = GetComponent<Rigidbody2D>();

    timeBetweenMoveCounter = timeBetweenMove;

    timeToMoveCounter = timeToMove;


// Update is called once per frame
void Update() {
    if (moving) {

        timeToMoveCounter -= Time.deltaTime;

        myRigidbody.velocity = moveDirection;

        if (timeToMoveCounter < 0f) {

            moving = false;

            timeBetweenMoveCounter = timeBetweenMove;


        else {
            timeBetweenMoveCounter -= Time.deltaTime;

            myRigidbody.velocity = Vector2.zero;

            if (timeBetweenMoveCounter < 0f) {
                moving = true;

                timeToMoveCounter = timeToMove;

                moveDirection = new Vector3(Random.Range(-1f, 1f) * moveSpeed, Random.Range(-1f, 1f) * moveSpeed, 0f);

Doesn’t look like you are setting the bool “moving” to true at the start which I think you meant.