Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Disable all inputs during cutscenes

Discussion in 'Scripting' started by Raclette, Aug 31, 2016.

  1. Raclette

    Raclette

    Joined:
    Oct 16, 2012
    Posts:
    15
    Hi all,
    does somebody know an easy way to disable all inputs (keyboard and mouse)during cutscenes?

    Thank you
     
  2. DonLoquacious

    DonLoquacious

    Joined:
    Feb 24, 2013
    Posts:
    1,667
    Nope, you'll probably need to make an input manager that handles all of the various input events in the game and then implement it yourself there. If you do google searches or check the asset store, there are probably dozens of implementations of generic input managers that can speed this up a bit, but frankly it's not that difficult to just do it yourself and scale it up as necessary.
     
    LiterallyJeff likes this.
  3. Pagi

    Pagi

    Joined:
    Dec 18, 2015
    Posts:
    132
    I would just put if(!playingCutscene) {} block into input update, that way you can easily leave out input for skipping the cutscene or pause instead of blocking all input globally.
     
  4. Raclette

    Raclette

    Joined:
    Oct 16, 2012
    Posts:
    15
    Thank you guys, I was hoping that there was a lazy way to do it. :)