- Home /
C# Decrease Mouse Sensitivity Camera Move
I have a script that makes the main camera follow the mouse. However I'm noticing that the camera is really sensitive to the mouse whenever it moves. I would like to control that sensitivity but I'm not sure how to implement it. I've tried Vector3 pos = Input.mousePosition / mouseSensitivity; and transform.position = Camera.main.ScreenToWorldPoint(pos) / mouseSensitivity; but neither appear have the effect I want. How exactly do you implement a variable that controls sensitivity?
using UnityEngine;
using System.Collections;
public class Camera_Move : MonoBehaviour {
public int mouseSensitivity;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
//Disable then replace with animation later
Vector3 pos = Input.mousePosition;
pos.z = transform.position.z - Camera.main.transform.position.z;
transform.position = Camera.main.ScreenToWorldPoint(pos);
}
}
Comment