Rotation of object against another object

In my scenario i have two objects one is cylinder and other is cube…
I want to rotate cube in such way the its end above the cylinder do not move from its position. And move left or right according to input values.
Find attachment.

Hello.

You question is too basic. How many time did you spent learning the basics of Unity?

Please, spend next week watching tutorials about basic aspects of Unity.

YOu only need to make it its child…

PS: Post Closed.