Help with hinges

Hi everyone.

Today i’m trying to create a chair on a chairlift. I want the connector bit to rotate with the steepness that the chair is going up at. So let’s say if it was going up at 45°, the connector bit would rotate 45° and so on and keep the actual part of the chair at 0° as shown below.


At 0°


At 45°

How would I do this effectively? I’m tempted to use hinges but not sure how to implement them so it works.