
---jump to current player position in 0.5s
function onBegin()
    --log("WalkAway")
    local distance = puppet.Position.X - player.Position.X
    if math.abs(distance) < 100 then
        playPuppetAnim("walk")
        local target = puppet.Position
        target.X = puppet.Position.X + (100-math.abs(distance))*puppet.Facing
        wait(speedXTweenTo((100-math.abs(distance))*puppet.Facing, 0.1))
        wait(0.5)
        wait(speedXTweenTo(0, 0.1))
    end
    playPuppetAnim("idle")
end
