I tried to make a ragdoll game and had the idea of making it a fun draggable ragdoll as my first game,tried making the drag script but i get this error: error CS0030: Cannot convert type ‘method’ to ‘Vector2’
Here is the script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class StickManDragger : MonoBehaviour
{
Vector2 difference = Vector2.zero;
private void OnMouseDown()
{
difference = (Vector2)Camera.main.ScreenToWorldPoint - (Vector2)transform.position;
}
private void OnMouseDrag()
{
transform.position = (Vector2) Camera.main.ScreenToWorldPoint(Input.mousePosition) - difference;
}
}