Hello,

I'm trying to get a movieclip of a person to climb a movieclip of a wall, but the wall is uneven, so I'd like the person to hug the surface of the wall closely (without leaving it at all, actually) as it climbs vertically up it.

This is the code I've come up with, but the player just goes to the wall's initial x value and climbs straight vertically from there, without following the curve of the wall:

Code:
var climbSpeed:Number = 5;
addEventListener(Event.ENTER_FRAME, climbing);
function climbing(evt:Event):void {
		if (player.hitTestPoint(wall.x, player.y, true)) {
			player.y = (player.y - climbSpeed);
		} else {
			player.y = (player.y - climbSpeed);
			player.x = wall.x;
		}
	}
Where am I going wrong?
Thanks.