Unity3D mouse cursor visibility - C# -
i want set cursor invisible , locked on middle of screen when game running, when in inventory or in menu want cursor visible , unlocked. made that:
if (tribe == game) { cursor.lockstate = cursorlockmode.locked; cursor.visible = false; time.timescale = 1; } else if (tribe == menu) { cursor.lockstate = cursorlockmode.confined; cursor.visible = true; time.timescale = 0; } else if (tribe == inventory) { cursor.lockstate = cursorlockmode.confined; cursor.visible = true; time.timescale = 0; }
conditions made , work (unless should call in every frame), lock states , visibility bugged. works, not (maybe it's caused fact run in unity editor) , it's behave weird. should call every frame or use wrong or something?
could update loop throwing error isn't caught , preventing logic running? saw few issues errors happening not showing in console, put try catch around whole update block , narrowed things down there.
Comments
Post a Comment