How to rotate object like in unity editor?

I need to rotate an object with mouse. How?

use (Input.GetMouseButtonDown(0)) if its left click
and Gameobject (Transform.rotate. );(whatever axis u want to rotate along)
I think this should work haven’t tried it myself .

I want to rotate it based on mouse movement and camera position.

You can use Input.GetAxis(“Mouse X”) for tracking mouse movement.
Regarding camera, what do you need to achieve ?