Hi, I'm facing a problem here that I wasn't seeing it coming when I first designed my game.
So, I'm using the ToggleCursor input feature.
But, I haven't figured how to track the cursor's state with a simple action, so everytime I use the input ToggleCursor, I also run an Active Input to change the value in a boolean global variable, and thats what I've been keeping track.
The player is able to switch between ThirdPerson and Fixed Angle as he goes, and may ToggleCursor anytime, to interact with hotspots.
But its getting complicated as more features are added, I know that it could get a lot simpler if I could just directly check if the cursor is constrained.
I am needing to check if the cursor is either locked or unlocked, to run specific Actions to either state.
Please help me
Comments
You can read if the cursor is currently locked with:
AC.KickStarter.playerInput.IsCursorLocked ();
However, the cursor also unlocks when in pause menus - and this is separate from the "toggled" state. If you want to set the in-game cursor's state to the value of a variable, you can use:
AC.KickStarter.playerInput.SetInGameCursorState (myStateBoolValue);
Currently the internal value this script uses to record this state (PlayerInput's toggleCursorOn boolean) is private. You can amend the script to make this public if you wish, and I shall provide a function to read this in the next update.