How to make camera move with the mouse cursors

Hello everyone, i searched this but couldn’t find the answers i want. The camera doesn’t moves with the mouse cursor, i need to make it look where the mouse cursor is, i could find this which is closest to my question :

but it’s about camera position, when i do that to my camera it goes too far somewhere in the scene, i just want camera to look where the cursor is.

Please help,:).

Whats about a simple script on the camera?
Just something like:

Camera mycam = GetComponent<Camera>();
Vector3 target = mycam.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, mycam.nearClipPlane));
transform.LookAt(target, Vector3.up);

(hope it work cant proof it on this mac , its CSharp by the way)

@rifintidhamar I agree, just as rifintidhamar first implied(and to my elaboration) there are multifaceted approaches and the current method presented can be scrubbed a bit, I suggest a GetAxis Cross Scew

@fffMalzbier you are missing a “)” in your code. :slight_smile:

@joeranbenker where is that code supposed to go? update or start?,@joeranbenker Where is that sensitivity code supposed to go? which method? Cause right now that changes nothing for me.

this method is really only useful for a joystick, and even then, using the get axis method is probably a better idea.

So uhh how do you stick it to one point and make it turn “around” that point/object? (if you haven’t understood the question think about Earth in Solar System) Thanks in advance for the answer.