Hi,
I’m trying to lock my cursor to the window when in build windowd mode.
using System;
using System.Collections;
using System.Runtime.InteropServices;
using UnityEngine;
#if UNITY_STANDALONE_WIN
[DllImport("user32.dll")]
static extern bool ClipCursor(ref RECT lpRect); //ERROR at bool
public struct RECT
{
public int Left;
public int Top;
public int Right;
public int Bottom;
}
#endif
public class Cam_Movement : MonoBehaviour {
public InputsForCamera[] Inputs = new InputsForCamera[1];
public float zoomMulti;
public float moveMulti;
public float turnMulti;
public GameObject CamParent;
private CamInputs camInput;
// Use this for initialization
public void Start()
{
RECT cursorLimits;
cursorLimits.Left = 0;
cursorLimits.Top = 0;
cursorLimits.Right = Screen.width - 1;
cursorLimits.Bottom = Screen.height - 1;
ClipCursor(ref cursorLimits);
}
dose anybody see the problem? I assume I’m just blind and not seeing it.
Thanks
SimssmiS