Camera Movement stuck after enabling and disabling input with "OnEnableGameplayInput "

Emmanuel

New member
So I just updated my plugin to the latest on the asset store and I am having issues where if I fire an event OnEnableGameplayInput to pause the character and camera when i send the corresponding to allow it. My camera rotation stops working. I have no idea why this is happening. The character movement resumes but camera doesnt. The same code worked before updating. I have also rolled back and it works. The version is v2.3.4
 
Could you share the code you'rse using in your OnEnableGameplayInput event to pause the character and camera? Did you have any modifications to base UCC scripts before updating? If so, those changes may have been overwritten by the update.
 
I did not make any modifications to this system. It is a multiplayer project using the pun addon. And it is a simple pause play setup.
where I do
EventHandler.ExecuteEvent(networkData.GetLocalPlayer().character, "OnEnableGameplayInput", false); to pause
and
EventHandler.ExecuteEvent(networkData.GetLocalPlayer().character, "OnEnableGameplayInput", true); to play.

As soon as I execute the first event. it works as normal. Cant move the player or camera.
but with the second, i can move the player again but the camera no longer moves
 
Are you able to reproduce this in the demo scene? I can't reproduce it by firing those events as you said - are you using a custom viewtype/movement type? Do you have any custom state presets setup on the cameracontroller?
 
So, I noticed it works if you fired this event via a mouse click EventHandler.ExecuteEvent(networkData.GetLocalPlayer().character, "OnEnableGameplayInput", true); as you do in the demo. If you do it via a key press. It doesnt activate the camera back. and thats how I pause and unpause the game. I use escape to fire this EventHandler.ExecuteEvent(networkData.GetLocalPlayer().character, "OnEnableGameplayInput", false); and escape again to fire this EventHandler.ExecuteEvent(networkData.GetLocalPlayer().character, "OnEnableGameplayInput", true);

Please try in the demo scene and try to fire the unpause controls events without using the mouse buttons at all. It wont work.
Actually, you can see this effect in the demo scene already.
 
It looks like you have some custom code with the networkData. How can I reproduce it within the demo scene of a fresh project?
 
I have the same issue since 2.3.4 that randomly the mouse control gets lost for the camera, but I was too lazy to further analyze it so far. Usually, opening and closing the UI helps fixing it. I also had no idea where to start as I am using UCC/Pun/UIS, and also the new input system. @EmmanuelO are you using the new or the old input system? I actually don't think that it is related to the PUN add-on.
 
So, I used the old input system and recently switched to the new. Same problem in both. I think the problem has to do with focus on the game window. I was using escape for pausing and escape for resuming. Now I was able to solve the issue by disabling "enable cursor by escape" on the character UnityInputSystem component.
 
Top