Added custom cursor

This commit is contained in:
Pasha Bibko
2026-01-20 15:23:59 +00:00
parent 12032c217c
commit 4126919c93
5 changed files with 156 additions and 4 deletions

View File

@@ -0,0 +1,27 @@
using UnityEngine;
public class FakeCursor : MonoBehaviour
{
public Camera AttachedCamera;
private void Start()
{
Cursor.visible = false;
}
private void Update()
{
Vector3 absolutePosition = new()
{
x = Input.mousePosition.x / Screen.width * 1920,
y = Input.mousePosition.y / Screen.height * 1080,
z = 5f
};
transform.position = AttachedCamera.ScreenToWorldPoint(absolutePosition);
}
private void OnDestroy()
{
Cursor.visible = true;
}
}