PLZ HELPP- my dc motor cant read my code

ok so what i want is for these two motors to work in turns… so one works for 5 seconds and the other one is off, and then they switch. we did this by adding delays in our code. it works on tinkercad but it doesnt work in real life. the motors dont seem to read the code as they dont delay and just keep going. why could this be? we checked our ardunio and everything- the code was uploaded properly.

heres the code:

void setup()
{
pinMode(13, OUTPUT);
pinMode(12,OUTPUT);
}

void loop()
{
digitalWrite(13, HIGH);
delay(5000); // Wait for 5000 millisecond(s)
digitalWrite(13, LOW);
digitalWrite(12,HIGH);
delay(5000); // Wait for 5000 millisecond(s)
digitalWrite(12,LOW);
}

attatched below is our circuit

What transistors are you using?

npn transistor

Well, it's not good that your drawing shows no base resistors on those "npn" transistors.

What is the partnumber of the transistors?

pn222a

whats a base resistor?

gurleenn:
pn222a

whats a base resistor?

I would check your wiring as well. Make sure that you got the pins on the transistor correct. If not that could explain your problem. Often if something simulates correctly but does not work practically, it is user error; you could have damaged the transistors by a static shock from your finger or maybe mixed up the base and the emitter.

You have no diodes across the motors. That causes interference and that upsets the running of the code.

Your title is wrong, motors do not read code, how could they?