Movement - GonksDevAccount/Projects GitHub Wiki

Here is the current movement code, most likely gonna change

` public float panSpeed = 10f; public float panBoarderThickness = 10f; public Vector2 panLimit; public float scrollSpeed = 20f;

void Update()
{

    Vector3 pos = transform.position;

    if (Input.GetKey("a") || Input.mousePosition.x <= panBoarderThickness)
    {
        pos.x -= panSpeed * Time.deltaTime;
    }

    if (Input.GetKey("d") || Input.mousePosition.x >= Screen.width - panBoarderThickness)
    {
        pos.x += panSpeed * Time.deltaTime;
    }
    if (Input.GetKey("s") || Input.mousePosition.y <= panBoarderThickness)
    {
        pos.y -= panSpeed * Time.deltaTime;
    }
    if (Input.GetKey("w") || Input.mousePosition.y >= Screen.height - panBoarderThickness)
    {
        pos.y += panSpeed * Time.deltaTime;
    }

    transform.position = pos;

}

`