I've mixed up a tutorial in preparation of my platform tutorial a couple weeks ago. It does exactly what you want to do.

Have a look in the tutorial section of my websiteif you're interested...