Graphic Raycaster Target prevents me from shooting with the mouse

Kehaw

Member
Hello

The value of `Graphic Raycaster Target` component's `Raycast Target` default is enabled.

If it is enabled, I can not use left button trigger fire action (Topdown Shooting style).

But if I disabled it, the float panel always reopen when I press `Esc`.

So, how to fix this problem by myself?

(I remember asking a similar question before, but I didn't seem to get a working solution.)

Thank you very much.
 
I'm not really sure what Raycast target has to do with the panel reopening with 'Esc'

But disabling the raycast target should be the right move in your case. I believe there is a component that lets you have a raycast target but lets input go through. I think it's setting a canvas group and setting the block raycast to false, you can try that to see if it makes a difference I'm not sure it works.

As to why 'Esc' returns to your panel. that's because your panel is set to selectable. Try setting it to "Not Selectable Panel".
1740133626785.png
This will prevent this panel to be opened by pressing "back" ('Esc')

The DisplayPanelManager is the component that handles opening panels on back. If you see that's something you do not want. Perhaps you can change the source code to disable that functionality.

Let me know if you find a solution and if you think I should make any changes to DisplayPanel or the Manager component
 
I'm not really sure what Raycast target has to do with the panel reopening with 'Esc'

But disabling the raycast target should be the right move in your case. I believe there is a component that lets you have a raycast target but lets input go through. I think it's setting a canvas group and setting the block raycast to false, you can try that to see if it makes a difference I'm not sure it works.

As to why 'Esc' returns to your panel. that's because your panel is set to selectable. Try setting it to "Not Selectable Panel".
View attachment 13701
This will prevent this panel to be opened by pressing "back" ('Esc')

The DisplayPanelManager is the component that handles opening panels on back. If you see that's something you do not want. Perhaps you can change the source code to disable that functionality.

Let me know if you find a solution and if you think I should make any changes to DisplayPanel or the Manager component
By default, I can close the floating panel by pressing Esc (when the mouse is on the floating panel), but this default setting will prevent me from triggering shooting with the left mouse button. So I disabled Raycast Target, and then I can trigger shooting.

However, this caused a new problem. When I opened two panels (Inventory and Equipment), I closed the first floating panel by pressing Esc normally, but when I closed the second floating panel, the first floating panel was reopened.

In the previous version of my project, I solved it by modifying the UIS source code. I raised this question again in the hope that there will be official support. Otherwise, I need to check whether this part of the code is overwritten every time I upgrade.

I remember that I implemented it by overriding the OpenBack method for fix it.

1740136564578.png

But you know, this is not a good idea.

Thank you topman.
 
Last edited:
Back
Top