using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
{
private Vector3 screenPoint;
void OnMouseDrag()
{
screenPoint = Camera.main.WorldToScreenPoint(transform.position);
float screenX = Input.mousePosition.x;
// float screenY = Input.mousePosition.y;
float screenY = screenPoint.y;
float screenZ = screenPoint.z;
Vector3 currentScreenPoint = new Vector3(screenX, screenY, screenZ);
Vector3 currentPosition = Camera.main.ScreenToWorldPoint(currentScreenPoint);
transform.position = currentPosition;
}
}
///////////////////////////////