When the U.S.S. Enterprise experiences problems with an anti-gravity unit, Geordi orders one of his engineers, Lt. Barclay, to investigate the malfunction. But when Barclay later claims that he's unable to find a problem, the anti-gravity field fails, causing a canister of alien tissue samples transported from a nearby planet to fall, break open and expose its contents.
After Geordi complains to the captain about Barclay, Picard advises Geordi to find a way to motivate him. Unfortunately, Barclay's attendance at an officers' meeting does little to inspire confidence in him and Barclay retreats to the Holodeck where he programs a session in which Counselor Troi seduces him. Later, when Picard mistakenly calls Barclay "Broccoli," a nickname used by the crew, Geordi finds him back in the Holodeck, engaged in a fantasy sword fight in which he defeats Picard, Data and Geordi.
Geordi then encourages Barclay to meet with Troi to discuss his need to vent his frustrations on Holodeck recreations. But before long, Barclay again begins shirking his responsibilities, which sends Riker, Troi and Geordi to the Holodeck to confront him about his obsession with the device.
Just then, the ship is jolted by a sudden increase in warp speed. Although Geordi sympathizes with Barclay's self-esteem problem, he explains that he desperately needs the lieutenant's help in engineering. Otherwise, the rapidly accelerating starship will automatically self-destruct within minutes.
With all other theories exhausted, Barclay deduces that the ship's malfunctions can be traced to crew members who were in contact with the canister that broke open earlier, and that they may have inadvertently spread some sort of contamination throughout the U.S.S. Enterprise's mechanical systems. Geordi concurs with Barclay's hunch and is able to save the ship just seconds before it would have self-destructed. Having gained confidence from the crisis, Barclay returns to the Holodeck one last time to bid farewell to his recreations.