Valeria Cotto, left, and Broklynn Prince, look at a (free!) rainbow in “The Florida Project.” (A24 Films)

There wasn’t a pot of gold at the end of the rainbow, but Sean Baker still saw dollar signs.

“We were like, if we shot that, we’d save the production 50 grand,” says Baker, the director and a co-writer of “The Florida Project.”

That sent him and his crew scrambling down the stairs of an Orlando motel and into a field to shoot a scene in which two girls (Brooklynn Prince and Valeria Cotto, both now 7) spot a rainbow and begin discussing the leprechaun that is certainly at its end.

“It was going to be a CGI rainbow,” Baker says. But two weeks before the cast and crew were scheduled to shoot the scene, “suddenly there’s everybody going, ‘There’s a rainbow over the motel!’ [It] takes 10 minutes to get the camera into an elevator and then down and dolly across the parking lot. We set it up, the thing is starting to fade, it’s fading, it’s fading, it’s fading, and when we got to it, it was like, ‘Roll, and GO.’”

All that effort proves that Baker has kept some of the on-the-fly style that helped his previous film, 2015’s “Tangerine,” grab people’s attention and garner dozens of nominations and awards on the festival circuit. That film, which follows a transgender sex worker looking for her pimp (who is also her fiance) on Christmas Eve, was shot entirely on an iPhone. “The Florida Project,” about the summer adventures of a girl (Prince) living in an Orlando motel — managed by the grizzled Bobby (Willem Dafoe) in the seedier, non-Disneyfied outskirts of town — was a more conventional shoot.

The film, which opens locally Friday, “is as guerrilla as I can get working with a budget of a couple million and a union crew,” Baker says. But “we were dealing with little kids, we were dealing with the hot summer sun of Orlando, and limited days. I asked for 60 days, I got 35. [So] we had to get pretty specific about what we were going to shoot, and have a schedule. At the same time, I always stressed to everybody that I may be inspired by something over there that’s not scheduled, and we’re going to have to break away.”

Baker says that freedom is something he would miss if he moves on to movies with bigger budgets.

“If I had my way, [shooting] would be 70 percent structured, 30 percent unstructured, so we would have happy accidents a lot,” he says. “It’s been harder and harder to do that, and if I want that to continue, I might have to drop my budgets and just tell people to go away.”