I've searched around and can find similar things but nothing exactly like my issue. I have certain segments where I need to disable the cursor and lock it (essentially a first person view so that the player can move the camera in FP view without showing a visible cursor).
My issue is that when I press Esc to access pause menu the cursor stays invisible (it does at least unlock though which is good, I know this because I can move the invisible cursor around and the menu items get highlighted when this invisible cursor moves over them). When I resume the game and exit the menu then the cursor becomes locked again and everything works perfectly.
I thought about inserting actions on the 'When turn off' and 'When turn on' action lists for the menu however whilst I have no issue enabling the cursor as being visible when the menu is turned on I can't simply then make it invisible when turning the menu off because there are obviously segments in my game where the cursor is indeed then visible and in these segments if I made the cursor go invisible when exiting the menu then this would be wrong for these segments.
When entering and exiting the menu the system does a great job of reverting the 'locked status' of the cursor - so when entering a menu the system knows to ensure the cursor is unlocked however when exiting the menu the system doesn't simply then lock the cursor, it knows that it must then revert the cursor back to how it was before pausing so surely there must be a way of doing the same thing with the cursor visibility?
p.s. looking for a solution I have realised that 'locking the cursor' is done using the Player: Constrain action however I've previously been calling the Toggle Cursor action within the player cursor script of the GameEngine object? Really not sure why I did this (was more than 12 months ago that I started this project and have been away from it for nearly 10 months so can't recall why I did this). Just wanted to check if the Constrain action has always been available?
Comments
The cursor should automatically be made visible once unlocked - you should only need a Player: Constrain Action to actually lock/unlock the cursor itself.
Some questions to try to pin the issue down:
Thanks again for the quick response, it really does make a huge difference! I mentioned in a previous post however I've had nearly 12 months off my project so I must have only just been exposed to the new cursor constrain option during the last week when I've returned to AC which explains why I was previously using the ToggleCursor in the PlayerCursor script in the game engine object!
Regarding your questions I can confirm that I am using the latest version (1.55c), my cursor is Software rendered and I'm working on PC (I've only ever ran in the editor, I can build the game though or just a scene and test it out in a game build though). Although to be honest I recall this being an issue for quite a while but it has always been a bug (in my game I think, not in Adventure Creator) that I've seen as low priority as it seemed something that should be an easy fix.
So essentially when I press Esc to enter the menu and the cursor is 'unlocked' then by default this should also make my previously invisible cursor become visible again? And then visa versa when I exit the menu and the cursor reverts back to being locked then the cursor should also revert back to being invisible too?
Certainly you should check to see if it occurs in builds. Also try temporaririly switching your Cursor Manager asset to Demo_CursorManager, so that you're using the default asset and we can see if the issue is with the way that's set up or not.
I'm assuming you have Hide cursor when locked in screen's centre? checked in your Settings Manager. Could you provide a shot of that whole section of the Settings Manager?
Please let me know how it goes - if this was caused by using an AC Action, then it could well be a bug - easy solution or not.
All sorted now mate, I've stopped using the old method of 'ToggleCursor' and instead I'm using the Player: Constrain action to lock the cursor and then with the option to 'always hide the cursor when locked' in the Settings section of the Scene Manager I'm not having the issue any more.
Well sort of solved, initially when doing the aforementioned changes the cursor would show up when I accessed the pause menu and unlock as desired however when resuming the game the cursor would lock back in however would then be visible rather than reverting back to hidden. However I took another piece of your advice above and ran a build of the level and in the build the cursor works perfectly as desired in all scenarios (only in the editor itself does it not hide again when exiting the pause menu). This is a completely non-issue for me and obviously I'd prefer it this way than the other way around, so consider this problem solved mate.
Thanks again for your continued help.
Mike.