I'm not sure I understand your code. What is the reason for setting up physics on the avatar if it's linked to the viewpoint? Perhaps all you need is viewpoint collision with the stepsize command to control when the viewpoint and avatar stops or moves up/down the ramp. Take a look at the
viewpoint collision tutorial for more on this topic.