using UnityEngine;
using System.Collections;
public class MouseFollower : MonoBehaviour {
public float renderDepth = 10.0f;
void Start () {
Screen.showCursor = false;
if(rigidbody) {
rigidbody.freezeRotation = true;
}
}
void Update () {
var mousePos = Input.mousePosition;
var wantedPos = Camera.current.ScreenToWorldPoint(Vector3(mousePos.x, mousePos.y, renderDepth));
transform.position = wantedPos;
}
}
thats the current code we are using but it isnt quite working we keep getting errors and dont know why. Thank you for any and all help