Small probability: after closing the inventory panels, can no longer control the character movement

wuyan

Member
I have a small probability problem. After added items to hotbar, and closed the inventory and equipment panel by pressing I key, then sometimes I can't control the character movement. I can still open/close these two panels by pressing the I key. But I can no longer control my character, must restart. Because the probability is very small, it is difficult for me to test. I don't know if the gameplay panel is not selected or for other reasons. Can anyone point out an way for me? Or what code should I start debugging from. Thank you.

1641832295718.png
1641832491240.png
 
Last edited:
I'm not sure what could cause this issue. Perhaps some other panel gets selected instead of the gameplay panel causing the display panel manager to get stuck in an invalid state.

The next time it happens, before exiting play mode. Go to the DisplayPanelManager inspector and enabled the debugInspector (available using the the vertical dots on the top right of the Inspector window). That should allow you to view the private fields and from there you can find what the selected panel is. That should at least let us know if the issue is related to the panel selected the wrong thing, or the input not enabling correctly.

Sorry I couldn't give you a better solution for now
 
I'm not sure what could cause this issue. Perhaps some other panel gets selected instead of the gameplay panel causing the display panel manager to get stuck in an invalid state.

The next time it happens, before exiting play mode. Go to the DisplayPanelManager inspector and enabled the debugInspector (available using the the vertical dots on the top right of the Inspector window). That should allow you to view the private fields and from there you can find what the selected panel is. That should at least let us know if the issue is related to the panel selected the wrong thing, or the input not enabling correctly.

Sorry I couldn't give you a better solution for now

Hello Sangemdoko, It happens again. Selected the item action panel. If I activated the Item Action Panel onece, when I close inventory panel,there is a high probability (but not always) that this will happen , the item action panel will be seclected not the gameplay panel.

1643096855895.png
 
Last edited:
Interesting, so the ItemActionPanel is selected, yet it is disabled?
I wonder when it gets selected.... Since this bug doesn't always happen it's a bit of a pain to know.
You're the only one that is experiencing this issue, so I wonder if it is something specific to your setup, or perhaps something to do with FPS/input.

When you close the Inventory Menu, is the ItemActionPanel opened or closed? Do you close the Inventory using "I", "Esc" or using the UI button?

If you can force it to happen after a few tries, what I would recommend is adding a Debug.log in the
SetSelectedPanel(PanelEventData eventData)
function of the DisplayPanelManager. You can print the eventData.ThisPanel and m_SelectedDisplayPanel to know what was previously selected and what will be selected. That should let us know if the Gameplay panel is never selected or if it is selected and then the action panel is selected.
 
Interesting, so the ItemActionPanel is selected, yet it is disabled?
Yes.

You're the only one that is experiencing this issue, so I wonder if it is something specific to your setup, or perhaps something to do with FPS/input.
Yes, I've made a few changes, Please take look at the three screenshots I sent on Jan 11. I want to use I to open and close both inventory and Equipment panels. But if I close one of them and the other one will open. So I made a change to "Is Non Selectable Panel" toggle. Please look at the second and third screenshots. Maybe I should merge inventory and equipment panels and use one Display Panel to control them?

When you close the Inventory Menu, is the ItemActionPanel opened or closed? Do you close the Inventory using "I", "Esc" or using the UI button?
All itemActionPanel closed when inventory closed. I use I to open and close.

If you can force it to happen after a few tries, what I would recommend is adding a Debug.log in the
SetSelectedPanel(PanelEventData eventData)
I've done this before. Let me show you screenshots.
1643118518738.png

1, The following screenshot are logs when NO problem.
1643119561003.png

2, The following two screenshots are logs when problem.

1643119504072.png
 
Last edited:
I think I'm starting to understand what's going on.
You open the the inventory with 'I' which selects the EquipmentPanel. Then you open the Item Action panel which selects it and set EquipmentPanel as the previous panel. You then close the Inventory which automatically closes the Item Action Panel, And for some reason the EquipmentPanel opens up the Item Action Panel.

Is there anychance you have the "I" button bound to other inputs other than Toggle the Inventory? Perhaps it is also used to click for some odd reason?

Perhaps you'll have better control by opening the Inventory and Equipment panel directly in a custom script. This way you can choose to open/close them without opening the "previous" panel. That should give you a lot more control on how to open/close panels and when to open the gameplay panel.

I know of another community member that changed the Panel source code, to make smart(open/close) default to not selecting the previous panel. Perhaps that can help you too.

Note that the Panel scripts can always be overwritten with custom code or even completely removed. The InventoryGrid, Equipment, etc..UI does not require Panels to work, but if you choose that route you'll need to bind the ItemSlotContainers to the Inventory in code.

I hope that helps solve this problem
 
I think I'm starting to understand what's going on.
You open the the inventory with 'I' which selects the EquipmentPanel. Then you open the Item Action panel which selects it and set EquipmentPanel as the previous panel. You then close the Inventory which automatically closes the Item Action Panel, And for some reason the EquipmentPanel opens up the Item Action Panel.

Is there anychance you have the "I" button bound to other inputs other than Toggle the Inventory? Perhaps it is also used to click for some odd reason?

Perhaps you'll have better control by opening the Inventory and Equipment panel directly in a custom script. This way you can choose to open/close them without opening the "previous" panel. That should give you a lot more control on how to open/close panels and when to open the gameplay panel.

I know of another community member that changed the Panel source code, to make smart(open/close) default to not selecting the previous panel. Perhaps that can help you too.

Note that the Panel scripts can always be overwritten with custom code or even completely removed. The InventoryGrid, Equipment, etc..UI does not require Panels to work, but if you choose that route you'll need to bind the ItemSlotContainers to the Inventory in code.

I hope that helps solve this problem
Hi Sangemdoko, Thank you so much! Now I set the item action panel to "is non selectable panel" to solve this problem temporarily.
 
Top