Yoyo playing may seem easy for a human, but it is a challenging problem for a humanoid robot. This paper presents an approach to generate yoyo motions for the humanoid robot, HRP-2, based on motion recorded from human yoyo playing, dynamical models and numerical optimal control techniques. We recorded vertical yoyo playing of 4 subjects measuring yoyo height and rotation angle as well as the corresponding hand motions. A detailed multi-phase yoyo model with impact collisions and control patterns of human yoyo playing were identified from these measurements. Based on this knowledge, reliable yoyo motions within the feasibility ranges of HRP-2 were generated using optimal control. The resulting motions have been implemented on the robot using open-loop and event-based quasi open-loop control strategies.