Turning touch to rotation

Hello!

So my game features an object in the center of the screen, and based on where the player touches I want it to rotate the object.

Ex.

Touch in bottom left hand side will rotate the object on it’s left side to make it see as if it’s being picked up on that side by the player’s touch. (C# references please)

How would I go about making this happen?
Thank you!

Sorry i don’t use C# only JS , but you can do this converting the touch cords from screen to world position.

Reference:

Then compare the touch cords with the object cords and for say:
If object.X is greater than touch.x it means the touch was made on the left side of the screen. If the object is at 0,0,0 an the touch on -50,0,0 … Same for Y then you can apply the rotation.

You can also check if the touch is on the left/top , right/bottom side of the screen, if the screen is 1980 x 1080 px , and the touch was at 435px,0 then its on the left, after that you can apply the rotation.