@Shando, i have tested the inputs and show/hide cursors.
Here is my sceneScript:
(Edit: Left the key input working all the time, otherwise it cannot be reengaged)
- Code: Select all
obj = 0;
function onInit(objID)
obj = objID;
--sky.print("Scene Script Acitve");
end
function onUpdate( td )
end
function onKeyDown( key )
if(key == "1")then
gui.hideCursor ( );
gui.enableGameInput ( 1,1 );
end
if(key == "2")then
gui.showCursor ( );
gui.enableGameInput ( 1,0 );
end
end
When pressing key 2, it successfully disengages the Mouse & Keys. But when enabling them again, it isn't working.
Edit: Oh duh, trying to reenable key press in a key press lol
When testing with just the mouse state(the second argument), it does work but when pressing key 1 to engage the mouse again, the camera seperates from the fps weapon. Press key 1 again and the camera goes back to the FPS and i can shoot again.
I made a new scene, added an FPS Player and added the script above to a sceneScript.
Press play to start the game.
Key 1 - re-engage the mouse (first press, camera is seperated, second press the mouse is activated again).
Key 2 - disengage the mouse