i want to create a console system. and i want obviously the player to be able to type. however there are like 12 other scripts in my scene that use inputs for opening a menu, an inventory, walking etc… i was wondering if there was any way i could stop these scripts from detecting inputs when im typing in console.
the two obvious answers is to one make a static bool that tells the other scripts when im typing (but that would require me to add an if statment to every single script that has an input.
and two to set time.timescale to 0 but that would only effect player movement. and also there is another script in my scene that alters timescale so it would screw that up.
is there a simpler way than the two i listed or is this it
First Question would be, are you using the “old” or “new” Input System?
im using
if(Input.GetKeyDown(Keycode.Enter)){
//do stuff here
}
You don’t want to ‘override’ input, you want to disable some and leave others active. This can easily be done by having some flag that guards input, or disabling the respective components, etc.
so would my original idea be the best way? having some static bool somewhere that when active stops all other imputs from happening accept on my message script?
Missed that in your post actually. But that’s a simple and effective idea, yes.
1 Like