Skip to content

Instantly share code, notes, and snippets.

@giljr
Last active March 3, 2018 13:24
Show Gist options
  • Save giljr/49b1665e63b022b6b70782c05c70fd73 to your computer and use it in GitHub Desktop.
Save giljr/49b1665e63b022b6b70782c05c70fd73 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Crosshair : MonoBehaviour {
// Use this for initialization
void Start () {
//hide the mouse cursor
Cursor.visible = false;
}
// Update is called once per frame
void Update () {
//make the mouse convas follows its position on screen
this.transform.position = Input.mousePosition;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment