Disable player input in third person when Canvas / UI is shown

Hello everyone, first post here. I’ve been playing around with Unity for around two months, so not many knowledge…

I was building something using the Starter Assets - Third Person Character Controller Pack Starter Assets - ThirdPerson | Updates in new CharacterController package | Essentials | Unity Asset Store

My idea is a simple adventure, where the player interact with NPCs to get dialogues. It’s using the new input system and Cinemachine; I was able to implement the dialogue UI (following instructions of this lesson

), it’s working the way I need.

But I don’t know how to disable the player inputs – like camera and character control – when the UI is called, so player can control the UI instead (press space or so to jump dialogues, or select options using mouse or D-pad, etc).

Any directions? If you need additional info, let me know. Thank you.

Sounds like you are using Unity PlayerInput, you can disable your input by calling input.actions.Disable();
Where input is a reference to the GameObiect PlayerInput component.

1 Like

Time.timescale=0;

game pause when ui showup