Having two custom pivot points to rotate around

Hello, I require two pivot points on either end of this rectangle, when the left key is pressed it should switch to pivot 1 and rotate anti clockwise around the pivot 1 whilst the left key is held down. The opposite should apply for when the right key is pressed, it should switch to pivot 2 and rotate clockwise around that end of the rectangle whilst the right key is pressed down.

I can’t seem to find an easy way of doing this, without a convoluted work around. Attempts at using custom points and moving the object center/origin point has resulted in strange misplacement of the rectangle when rotating.
How can this be done?

Thank you.

I guess you will have to use physics joints because you can’t have two different center points, and you can’t define a custom rotation point in the standard actions. :thinking:
image

We have a couple of example projects demonstrating physics, take a look.