I currently have a scene that uses a lot of OnMouseDown interactions. I would like to use a crosshair in place of the mouse click, how would I do this?
I have a GUI crosshair that shows up, but how do I lock the mouse (and hide it) to the center of the screen?
I have tried this page, but I am still not able to get it to work. I am still very new to unity, so I would appreciate it if you could explain in a simple way - like where do I attach the script, and what else needs to be included?
Much appreciated.
EDIT: I got the mouse locked with the following script, but not at the center of the screen. Ideas?
using UnityEngine;
using System.Collections;
public class screenLock1 : MonoBehaviour {
void Update()
{
if (Input.GetKey(KeyCode.Escape))
Screen.lockCursor = false;
else
Screen.lockCursor = true;
}
}