Problem with acceleration in Flappy Bird game

Hey, i know this is very basic stuff but could you help? Initially i wanted when player score == 5, velocity would rise but after it’s increased is goes down to startMoveSpeed. I just got back to this code after a while and i don’t remember what is what

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PipeMoveScript : MonoBehaviour
{
public LogicScript logic;
public BirdScript bird;

public float startMoveSpeed = 10f;
public float acceleration = 0.5f;
public float currentMoveSpeed;
public float maxSpeed = 30f;
public float lastSpeed;


void Start()
{
    logic = GameObject.FindGameObjectWithTag("Logic").GetComponent<LogicScript>();

    currentMoveSpeed = startMoveSpeed;
    lastSpeed = currentMoveSpeed;
}


void Update()
{
    transform.position += (Vector3.left * currentMoveSpeed) * Time.deltaTime;
    if (transform.position.x < -35f)
    {
        //Debug.Log("Pipe deleted");
        Destroy(gameObject);
    }

    if (logic.playerScore % 5 == 0 && logic.playerScore != 0 && BirdScript.birdisAlive == true)
    {
        
        pipeAcceleration();
    }

}

void pipeAcceleration()
{
    currentMoveSpeed += 2f * Time.deltaTime;
    lastSpeed = currentMoveSpeed = Mathf.Clamp(currentMoveSpeed, startMoveSpeed, maxSpeed);
    Debug.Log("CurrentMoveSpeed: " + lastSpeed);

}

}

If I understand your design correctly, each of your pipes have the script PipeMoveScript attached. That means that each pipe has its own independent movement speed.

Pipes are destroyed when their X position goes below -35, meaning that you are instantiating new pipes from somewhere else. As the initial speed of each pipe is set during the Start method, new instances will have the movement speed reseted to the initial value when they are created.

Could that be the problem?

There are multiple approaches, but you already figured out the general idea.

The speed of the pipes (game difficulty) is something that could be managed by a separate script, which would take care of the speed increases, reseting the default value on start, etc. Then, PipeMoveScript could read that value to execute the movement.