Basically the same way you would keep your player character from moving through objects; make collision check.
Something like
for char = charStart to charStart + totalChars
for obstacle = objStart to objStart + totalObjs
intersection# = intersect object(char, posX, posY, posZ, objX, objY, objZ)
if intersection# <> 0.0 and intersection# < 50.0 `or whatever value
`do whatever you wish to keep the characters from moving through solid obstacles here
else
`And here you put the normal (non-collision) code
endif
next obstacle
next char
(That's pseudo code, by the way)
"I kören hörs de brummande busarna Björnligan och Gondolen"