I want to move connected rigid bodies as in image example, one of them needs to rotate around a point. Then using ground check I want to rotate it back to line I tried using hinge joint 2d, using angle limits, but can not control rotating angle.
How can I achieve this effect? thanks.
![rotate position]](https://i.stack.imgur.com/o0TTc.png)
Edit: Tagged both rigidbodies as fixed angle and then applied rotation to upper object
void Update () {
if(Input.GetKeyDown(KeyCode.F)){
zRotation += 45;
myGameObject.transform.eulerAngles = new Vector3(myGameObject.transform.rotation.x, myGameObject.transform.rotation.y, zRotation);
}