RF transmitter trouble shooting

So I’ve been working on a project using rf transmitters and I just can’t seem to get a solid connection. I am using a Arduino nano as the transmitter with this code

#include <VirtualWire.h> //include radio transmission library

//define button pins on remote
const int lsrbutton = 2; 
const int lsmbutton = 6; 
const int lslbutton = 8;


//define button state values - using pull up resistance so when a button is pressed an output of 0 occurs
int lsrstate = 0; 
int lsmstate = 0;
int lslstate = 0;

int TX_PIN = 10;//transmitter pin
int TX_ID = 10; //transmitter adress

typedef struct roverRemoteData //add structure to data and storage space for output values
{
  int    TX_ID; //transmitter ID
  int    lsr; //removal button state
  int    lsm; //shoot button state
  int    lsl; //transform button state

};

void setup()
{
  Serial.begin(9600);
  pinMode(lsrbutton, INPUT_PULLUP); //use internal pullup resistance on buttons
  pinMode(lsmbutton, INPUT_PULLUP);
  pinMode(lslbutton, INPUT_PULLUP);

  vw_setup(2000); //setup and begin communication at 2000bps
  vw_set_tx_pin(TX_PIN); //set transmitter pin
}
void loop()
{
  lsrstate = digitalRead(lsrbutton); //check all button states
  lsmstate = digitalRead(lsmbutton);
  lslstate = digitalRead(lslbutton);

  struct roverRemoteData payload; //payload data goes here


  payload.TX_ID = TX_ID; //send radio adress
  payload.lsr = lsrstate; //send button states
  payload.lsm = lsmstate;
  payload.lsl = lslstate;



  vw_send((uint8_t *)&payload, sizeof(payload)); //send the data
  vw_wait_tx(); //wait to finish sending

  Serial.println("sent");
  Serial.println(lsrstate);
  Serial.println(lsmstate); //debugging make sure that values sent are ok
  Serial.println(lslstate);
  delay(50);


}

and a Arduino Mega as the receiver with this code

#include <VirtualWire.h>//include motor, radio transmission, and servo libraries

int RX_PIN = 4;//reciever pin
int RX_ID = 10;//reciever id
int TX_ID; //place to store transmitter ID

int lsrcount = 0;
int lsmcount = 0;
int lslcount = 0;

int leftservo = 10;
int middleservo = 11;
int rightservo = 12;

int lsrs = 5;
int lsms = 7;
int lsls = 9;

typedef struct roverRemoteData //add structure to data and set variable places to store incoming values
{
  int TX_ID; //transmitter ID
  int lsr; //left light switch
  int lsm; //middle light switch
  int lsl; //right light switch

};

void setup()
{
  pinMode(lsrs, INPUT_PULLUP);
  pinMode(lsms, INPUT_PULLUP);
  pinMode(lsls, INPUT_PULLUP);
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(9600);
  
  vw_setup(2000); //setup and begin communication at 2000bps
  vw_set_rx_pin(RX_PIN); //set RX pin
  vw_rx_start();

}
void loop()
{
start: //label where goto function takes program
  Serial.println("Start");

  struct roverRemoteData receivedData;
  uint8_t rcvdSize = sizeof(receivedData); //find incoming data size
  vw_wait_rx(); //start to receive data now- wait for message

  if (vw_get_message((uint8_t *)&receivedData, &rcvdSize)) //check for avalible data
  {
    Serial.println("lsr"); //debugging - send button states that have been send to the serial monitor
    Serial.println(receivedData.lsr);
    Serial.println("lsm");
    Serial.println(receivedData.lsm);
    Serial.println("lsl");
    Serial.println(receivedData.lsl);

    if (receivedData.lsl == 1)
    {
      lslcount == lslcount++;
    }

    else if (lsls == 1)
    {
      lslcount == lslcount++;
    }

    else if (lslcount == 0)
    {
      analogWrite(leftservo, 180);
    }

    else if (lslcount == 1)
    {
      analogWrite(leftservo, 0);
    }

    else if (lslcount == 2)
    {
      lslcount == 0;
    }

    else if (receivedData.lsm == 1)
    {
      lsmcount == lsmcount++;
    }

    else if (lsms == 1)
    {
      lsmcount == lsmcount++;
    }

    else if (lsmcount == 0)
    {
      analogWrite(middleservo, 180);
    }

    else if (lsmcount == 1)
    {
      analogWrite(middleservo, 0);
    }

    else if (lsmcount == 2)
    {
      lsmcount == 0;
    }

    else if (receivedData.lsr == 1)
    {
      lsrcount == lsrcount++;
    }

    else if (lsrs == 1)
    {
      lsrcount == lsrcount++;
    }

    else if (lsrcount == 0)
    {
      analogWrite(rightservo, 180);
    }

    else if (lsrcount == 1)
    {
     analogWrite(rightservo, 0);
    }

    else if (lslcount == 2)
    {
      lsrcount == 0;
    }

    else
    {
      delay(50); //if no message recieved wait 50ms then check again
      digitalWrite(LED_BUILTIN, HIGH);
    }

  }
}

Each Arduino has 3 switches attached that should be used to turn servo motors using the analog write function. The issue I am looking to solve is the radio communications and if there are errors in my code that are causing a communications failure, but so far without error messages I am at a loss. Thanks in advance for the help!

Do these errors depend on range?
Does it work when the two are only an inch apart?

I have antennas on my transmitter and receiver, but no matter the range I do not receive data.

Did you try the example programs on the VirtualWire web page first, to prove the hardware is working ?

Yes, my hardware is functioning.