Where is the Inventory Standard Input Script?

Fjord

New member
Hi, I am watching the tutorial video and now I am wondering where to find the "Inventory Standard Input Script". Just like in the Video "Item View Slot Container" I want to prevent my Character from moving when having the Inventory open.

My Character GameObject has only a "Unity Input Script". and when I attach an "Inventory Standard Input Script" to the Character there are no options below it like in the video.

I started with the RPG style and deleted the ItemShapGrid and created an Inventory Grid there instead....but I dont think it is because of that.
 
The video tutorial is a bit outdated, we recently changed how the input works in the system and the Inventory Standard Input Script is deprecated. I should have added a message saying it is deprecated in the inspector, sorry.
We use the Unity Input script instead.

Now you can choose the enable/disable input when a menu is open by ticking this option on the Display Panel Manager:
1618820252307.png
You'll need to be sure to set a gameplay panel to make that work.

You can also enable disable the input through script if you wish (replace true by false if you want to disable the input):
Code:
EventHandler.ExecuteEvent<bool>(m_CharacterGameObject, EventNames.c_CharacterGameObject_OnEnableGameplayInput_Bool, true);
 
Thanks for the answer. Unfortunately this option doesn't work for me. I followed the steps in the video and made a Gameplay Panel which is linked in this Component. It is not possible for me to click something in the Game world while the inventory is open which is fine. But I can still walk with W A S D and Change the cursor position in the inventory at the same time..

Btw: I think the Gameplay Panel was being set to the wrong place in the video. There it is a direct Child of the Inventory Canvas and set to be active on open and Start Enabled. This means it is always in the game and prevents me from clicking in my game world right away. Maybe it didn't matter in the tutorial because there was nothing to be clicked in that world. But for me it only worked when i put the GamePlay Panel as a Child of the "My Inventory Grid Panel" so that it gets active only when I have my Inventory opened via button.
 
The gameplay panel must be separate from the inventory panel.
The name "gameplay" means it is the panel you have enabled while playing and moving around with the character. Even though it is called panel that does not mean you need an image that covers the screen you can have a panel with just UI on the sides or nothing at all.
In the gameplay panel you'd usually put your health, the hotbar, buttons to open menus, etc...

When that gameplay panel is activated by the system the input will be enabled. When it is disabled by the system the input will be deactivated.

If you put your gameplay panel within your inventory panel that defeats the purpose of a gameplay panel.

The gameplay panel will only prevent clicks if you have an image that covers your screen, it's not necessary to have that.
But in case you need to detect a click in the gameplay panel and also in the background you can use a function to let the click event pass through. For example our GraphicRaycastTraget component has that option.

I hope that makes sense
 
I just answered another question about cursor and input being activated/deactivating when using menus. I thought these screenshots might be relevant to what you want to do.
unknown.png


unknown.png
 
Thanks a lot for explaining these basic things to me :) But i already tried it with the Gameplay Panel in the right position in the hierarchy. It is still not preventing me from moving my Player while the Menu is open. But it prevents me from clicking in my game World. I just found out that the configuration inside my Display Manager changes nothing no matter which option i choose. Time Scale to zero doesnt work either. The other options you showed are working: I can disable the cursor though I need it always in my game.

restarting unity didnt help. I think I try to work around by preventing my Player Input with a script. I hope the Gameplay Panel is not important for the further steps. I need to delete it or at least deactivate the Raycaster Target Component as the " Click Pass Through" seems not to work in my case either... Maybe i just messed sth up because I first made those custom Inventories (rpg and classic) and deleted them and then started to make my own with the help of the video tutorials...
 
Just to be clear how do you move your character? Are you using a custom script?
If that's the case we do not disable al inputs, we only disable inputs that come from the "Unity Input" component that is set on the character.

Apart from that the fact that time scale to zero doesn't work seems odd to me. Is it possible that when you created/removed/created again the UI you did not delete the previous UI completely? Maybe you are editing a component that you are not using?

Try setting a new scene with just your character and the UI to see if that works, it might help you debug what is happening.
 
Ah okay, I am using my own script. So I should move every Input code inside the Unity Input script to ensure the disabling of the movement? This makes things clearer now. It doesnt explain everything but I will work with that for now. Thank you for taking the time and answering me :)
 
Just to make it a bit more clear.
You can use the OnEnableGameplayInput event to know when to enable and disable the input within your own scripts:

Code:
EventHandler.RegisterEvent<bool>(gameObject, EventNames.c_CharacterGameObject_OnEnableGameplayInput_Bool, HandleEnableGameplayInput);

Check the "Character" script from the demo scene to see an example of that in code
 
I was under the impression that we didn't have to know how to code to use this asset, but I'm pouring through several different complicated scripts trying to figure out how the EnableGameplayInput event works and how to implement it in my code, and I'm having a significant amount of difficulty understanding any of it.

It really seems like there should be detailed instructions on what I need to have in my player script so that this asset works. Is there any way you can provide those?
 
@MerlinsMaster Unfortunatly (or fortunatly depending how you see it) we cannot disable your character input for you.

There is a non-code solution which is to set the option to set time scale to 0 when a manager is opened:
1627455548257.png
But in many cases you just want to disable the character input and not pause the entire game.

In that case the only way is to use the Event I mentioned above.

There are many ways you can use that event in your character script. If you check your character input in the Update loop then the simplest solution I can think of is what I do in the UIS Demo scene for the demo character.

Code:
//Register to the event in awake.
protected virtual void Awake()
{
    EventHandler.RegisterEvent<bool>(gameObject, EventNames.c_CharacterGameObject_OnEnableGameplayInput_Bool, HandleEnableGameplayInput);
}

//Enable/Disable the character component (prevents the Update loop being called.)
private void HandleEnableGameplayInput(bool enable)
{
    enabled = enable;
}

//Unregister the event on destroy
private void OnDestroy()
{
    EventHandler.UnregisterEvent<bool>(gameObject, EventNames.c_CharacterGameObject_OnEnableGameplayInput_Bool, HandleEnableGameplayInput);
}

This only works if you've set your character gameobject as the Panel Owner. Whether it is manually or using the InventoryIdentifier. And if you are using a gameplay panel.

I hope that helps
 
What kind of UI are you using? A Main Menu or floating panels?

The Time Scale to 0 I believe is only set if a Menu is opening, not any panel. While the disable input option disables input if any panel except the gameplay panel is selected.
It is also possible that your own scripts control the time scale which could interfere with our panel manager.

Feel free to send me a screen shot of you Display Panel Manager inspector and your UI, perhaps it could give me an idea of what's going wrong.
 
So if I'm understanding correctly, you need to have an actual main menu in order for the time scale to 0 to work? Simply having a floating panel will not work. If that's the case, then I understand what the issue is.
 
Yes, that is exactly it.
You can set any panel as a Menu in the inspector:
1627888854474.png
They act slightly differently. For example you can limit to only have a single Menu open at a time by preventing opening other menus or closing the current menu before opening the next one.

Were you able to solve your issue in the end? If it helps I could add an optiong to set time scale to 0 is a non-gameplay panle is opened (I don't recommend it though) or add a UnityEvent so that you can hookup any custom script in the inspector
 
Were you able to solve your issue in the end? If it helps I could add an optiong to set time scale to 0 is a non-gameplay panle is opened (I don't recommend it though) or add a UnityEvent so that you can hookup any custom script in the inspector

Yes. The set time scale to 0 works if I have a menu in the scene. That should work for the project I'm working on, since I don't foresee any scenario in which I would NOT want to pause the game when accessing an inventory. But if you want to add that option to hook up a custom script in the inspector, I would not object to that. It can't hurt to have the option.

Thanks again for your assistance.
 
Yes, that is exactly it.
You can set any panel as a Menu in the inspector:
View attachment 6687
They act slightly differently. For example you can limit to only have a single Menu open at a time by preventing opening other menus or closing the current menu before opening the next one.

Were you able to solve your issue in the end? If it helps I could add an optiong to set time scale to 0 is a non-gameplay panle is opened (I don't recommend it though) or add a UnityEvent so that you can hookup any custom script in the inspector


Hey there,

I'm have the same problem as the original poster. I'm using an ultimate inventory system as well as an ultimate character controller. I find that as long as I'm having a game panel in the scene my shooter weapon doesn't fire(it a prefab in the demo of UCC). Also, I get an error:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateInventorySystem.UI.Panels.DisplayPanelSelector.SelectPanel () (at

By reading the former post, I 1) deleted the gameplay panel 2)set time scale to 0 3)enable is panel 4)Enable input on gameplay selected, the inventroy works fine along with game plaused while inventry grid opening and the problem seems solved. However, I wonder how to setup if I don't want that game pause? Even if i read through the documation and the discussion above I still don't get it. Also I think the modification should be made to the video tutotial if that't no longer case and it's been two years.
 
What UCC version are you using 2.X or 3.X?
Could you explain exactly what behaviour you want, I'll see if I can make it work in the demo scene and if not, we can discuss what changes would need to be done to allow that behaviour.
 
Top