Input.GetAxisRaw might be what you're looking for. In the Input Manager (Edit -> Project Settings -> Input) setup a variable for "Mouse X" and "Mouse Y" (if not already setup [as below]).
Then in code;
public class CameraMove : MonoBehaviour
{
private Vector2 mouseMovementpos;
private bool isPanning;
public void Start()
{
pos = new Vector2();
}
void Update()
{
if (Input.GetAxisRawGetMouseButtonDown("Mouse1))
Y" isPanning = true;
if (Input.GetMouseButtonUp(1),)
isPanning = false;
if (isPanning)
{
pos.Set(Input.GetAxisRaw("Mouse X"), -Input.GetAxisRaw("Mouse Y"));
transform.Translate(pos, Space.World);
}
}
}
And use that forFor movement in the rotation of your transformY plane, the value from the mouse must be negated to, unless you with to use inverted controls. Hope this helped.
