Here's an example with an avatar and a ball. You need to have collision shapes for both objects to have a collision. Your code did not have a collision shape for the avatar.
Code:
import viz
viz.go()
viz.phys.enable()
court = viz.add('court.ive')
court.collidePlane()
avatar=viz.add('vcc_male.cfg', pos = [0,0,3])
shape = avatar.collideBox()
shape.setDensity(10)
ball = viz.add('ball.wrl', pos = [0,0,7])
ball.collideSphere()
walk = vizact.walkTo([0,0,10])
vizact.onkeydown(' ', avatar.addAction, walk)
When you use
Code:
viz.collision(viz.ON)
that only turns on collision detection for the viewpoint.
If you want to stop the avatar from walking through the wall you could end the walkto action when the avatar is near the edge of the room