using UnityEngine;

public class MaskAction : MonoBehaviour
{
    public Camera mainCamera;
    public GameObject mask;

    private void Start()
    {
        mask.SetActive(false);
    }

    void Update()
    {
        Vector3 mousePos = Input.mousePosition;

        Vector3 worldPos = mainCamera.ScreenToWorldPoint(mousePos);

        mask.transform.position = new Vector3(worldPos.x, worldPos.y, 0f);

        mask.SetActive(Input.GetMouseButton(0));
    }
}
