Cannot properly mate assembly

RED: FIXED

YELLOW: follower (moves up and down)

GREEN: turns around, with a knob.

I want the yellow block follows the green surface while rotating, so it will stay during +-350° at his position but when it passes the knob the yellow block has to move upward. I tried coincident mate and cam mate but both fail to do what I want.

Can anybody help?

Kind regards!!

SolidworksAssemblies