英文:
OnPointerEnter being blocked by canvas group
问题
I set up an inventory system, now I am working on setting up the ability to open and close it. I figured I could use a canvas group to set the alpha to 0 and then disable the relevant lines of code in the inventory scripts. I'm not at that point yet because the canvas group has stopped OnPointerEnter from working. Here is the code for the pointer enter.
It does not work when the hierarchy is like this.
But it does work when the hierarchy is set up this way, so I'm pretty sure the issue is the canvas group is blocking the inventoryGrid OnPointerEnter from working.
So, why does the canvas group block the pointerEnter, and is there a way around it? Or will I have to just have a better way of hiding the inventory screen?
英文:
I set up an inventory system, now i am working on setting up the ability to open and close it. I figured i could use a canvas group to set the alpha to 0 and then disable the relevant lines of code in the inventory scripts. Im not at that point yet, because the canvas group has stopped OnPointerEnter from working. Here is the code for the pointer enter.
it does not work when the heirarchy is like this.
but it does work when the heirarchy is set up this way, so im pretty sure the issue is the canvas group is blocking the inventoryGrid OnPointerEnter from working.
So, why does the canvas group block the pointerEnter, and is there a way around it? Or will i have to just have a better way of hiding the inventory screen?
答案1
得分: 0
检查你的CanvasGroup的Interactable和BlockRaycasts属性。你可以在这里找到更多信息。
英文:
Check the Interactable and BlockRaycasts properties of your CanvasGroup. You can find more info here.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论