More than a dozen students opposed to the demonstrators’ views chanted, “Mock shootings, mock victims,” as they confronted the gun-rights advocates along Guadalupe Street.

“It’s ridiculous,” said Lauren Ferguson, 22, an English major from Austin. “When you make a mock shooting, you’re mocking real victims of shootings.”

The gun-rights advocates stored their weapons in their cars before the walk, then abruptly moved the location of the mock shootings two blocks so that it was out of sight of most of the media as well a noisy opposition group. Murdoch Pizgatti, the president of the two gun-right groups staging the event, said the change was made because protesters at the original site were "not going to give us a space to voice our opinions," and to stress the point that mass shootings are never announced and cannot be anticipated. Plans for the mock shootings prompted national media attention after the demonstration was announced earlier in the week. Many gun-control advocates and other people, including some who support campus-carry laws, denounced it as highly inflammatory in light of the recent mass attacks in Paris and San Bernardino, Calif. Student leaders also complained that because the event was so close to the campus, noise from the demonstrators would interfere with studying for final exams. “It’s an attempt to terrorize the student population and to inflame the campus-carry debate,” said the president of the University of Texas’ student body, Xavier Rotnofsky, 21. Mr. Rotnofsky, a senior, added that it coincided with a “very stressful time for students.”

But a spokesman for the event’s sponsors vigorously defended it as an effort to draw attention to what he said was a need for increased protection in a world growing more dangerous.