I created a mouse lock script to lock the mouse cursor in the center of the first person controller camera… but i dont knw where to attach it. This is the script…
using UnityEngine;
using System.Collections;
public class MouseLock : MonoBehaviour {
// Update is called once per frame
void Update () {
if (Screen.lockCursor == false)
{
if(Input.GetMouseButtonDown(0))
{
Screen.lockCursor = true;
}
}
}
}