Hi folks!
I've been experimenting with using AC and Opsive's First Person Controller together and have used the integration with very few issues, I have however encountered a slight issue with the cursor that I have been unable to solve.
Whenever I close the default AC "pause" menu with the esc key or even by clicking resume, mouse control is not returned to the camera. Mouse control only seems to return once I interact with the game window again by clicking. I have tried switching the mouse from "software" to "hardware", hardware mode resolves issues with the cursor not appearing, however the un-paused camera control bug is still present.
The player is still able to move, it is just the control of the camera that seems to get stuck. I have set the character and scene up according to the UCC integration documentation and have been scratching my head about this issue for a while! I am unsure whether I have just set something up incorrectly or not, but the issue occurs every time I try to recreate it.
Has anyone else experienced anything similar to this while using AC and UCC? Any assistance on this would be hugely appreciated! Thanks folks!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @maxzo.
Is this an issue that occurs in builds, or only the Editor?
When you say mouse control is not returned, do you mean that the mouse is unlocked and moveable around the screen - or that it's locked in the centre but unaffects the camera?
This may be a case of UCC's Unity Input component conflicting with AC, since both take control over the cursor's "locked state". Though I can't recreate the issue on my end, it'd be worth placing Debug.Log statements in your UnityInput script next to any calls to Cursor.lockState in order to see which (if any) are being called.
If so, it'd then be a case of commenting them out to see if that causes things to work properly. It may then be necessary to subclass the script and override any functions that make such calls.
Thanks for your response Chris! You hit the nail on the head with it being UCC's Unity Input component! I used Debug.Log statements to locate the conflicting code and have simply commented it out for now, but will return to it when/if necessary. Doing so has resolved the issue with the mouse not affecting the camera after unpausing!
I am having one more issue regarding the pause function. I am under the impression this may also be related to some sort of input conflict but aren't 100% sure. When the game is un-paused, if the cursor has been moved, the player camera will jarringly rotate as soon as control is returned.
I believe this is because UCC control isn't pausing correctly and is still taking input on the pause menu, though it is worth noting this was also happening before commenting out the previously mentioned code.
Thanks again for your assistance, I absolutely love the AC toolkit and appreciate the support!
Does it move as if to "catch up" with mouse movements made while the game was paused, i.e. the different in mouse position between pausing/unpausing?
It sounds like a UCC issue, but might be just a case of tweaking which code you're commenting out. I'd recommend reaching out to Opsive for advice.