The rotation is not in one direction only, not laggy anymore but still not as wanted : it is happening whenever I move to mouse, whatever the direction is (.gif of it : https://imgur.com/a/1om7kZG). Tbh I am kinda lost right now, bumping (again) my head against the walls.
EDIT_1 : both rotations are working fine, but I need to clamp the Y axis rotation (max 90° for exemple). And I am stuck again, missing something. Kinda driving me crazy as it seems to be “a simple thing to do”.
EDIT_2 : thx to Nuverian, it is working!
The RotateAround method does not really work well with clamping. It is a pre-canned Unity method that unless you make it really complex or rewrite the method, it best works without clamp (techincally that is because it also modify the position of the object instead of only its rotation).
As such, I would suggest to use a direct approach for setting the rotation of an object. For this to work, you will need to have the Camera parented to an object that you want to be the “targetOfCamera” basically, and have that target object rotate instead (and as such make the camera rotate around it since the camera is parented to that object).
Note that the “min” and “max” values of Mathf.Clamp method should be within positive range (0 – 360) for this to work, otherwise more complex script is required
The working flowscript, tuned for my needs (I still need to tune it a bit more and then, I will drop the flowscript.asset) :