How to stop camera look vector

sythe

New member
I just want to be able to pause/resume the camera look behavior, it seems that into your UnityInput script you're it thought "OnApplicationFocus" that (if I understood it right) can only be triggered through "OnEnableGameplayInput" event, which for some reason aren't being triggered when called outside. Let me know the additional information that you need

EDIT: Its first-person controller
 
What exactly do you want to achieve? If you send the OnEnableGameplayInput event the input will be disabled, and the camera stops moving. This could for instance be used while showing a menu or inventory.
 
This is exactly what I want, stop motion while navigating thought inventory, BUT it seems to not be working and I don't see why. If I had understood it right, the event is registered thought PlayerInput awake, but it seems to not be working, so I want some help to discover what is removing the listener.
 
It works fine in the demo scene. If you press ESC to view the helper UI, or enter the car, the user input is disabled. How do you execute the event?
 
The ESC button works because it is stopping the input through the OnApplationFocus (an internal API of yours) and not though the OnEnableGameplay.
1655906197564.png

When I try to execute the event through EventHandler.ExecuteEvent the input simple didn't stop, but the event is being called for sure
 
The event is fired when you hit ESC the second time to show the UI controls, not the first time for enabling the cursor.
 
Can you show where in the code? because into UnityInput I just see the ESC key being verified one time in LateUpdate.

But anyway, I have wrote a simple script to register and trigger the event
1655907798279.png

And the WhenInput is called when I trigger it thought K, but the gameplay input didn't stop, so I suspect that at some point the character is being removed as listener
 
You have to execute/register the event on the player game object.
Code:
EventHandler.RegisterEvent<bool>(gameObject, "OnEnableGameplayInput", EnableGameplayInput);

EventHandler.ExecuteEvent(m_Character, "OnEnableGameplayInput", false);
 
Top