Question by
andreyazbyn · Nov 25, 2015 at 02:15 PM ·
c#camera-movement
camera drag
How can I move the camera like in civ 5 (if you drag from a tile that tile remains at the mouse position)
there's what I have so far but it's not working as intended
Vector2 mousePos = new Vector2(-Input.GetAxis("Mouse X"), -Input.GetAxis("Mouse Y"));
if (Input.GetMouseButton(1))
{
Vector3 move = new Vector3(mousePos.x * dragSpeed, mousePos.y * dragSpeed, 0);
rb.AddForce(move, ForceMode.Force);
}
Comment
Your answer
