I am attempting to create a Unity UI for an inventory, similar to your tutorial. I have a couple buttons that control visibility of elements within the UI. When clicking on these UI elements the character moves when he should not, most likely because the click is also being interpreted as a 'move to location' event.
I would like to stop the character from moving to this location when the UI element is clicked. I have added these elements to the Menu and assigned the clicks to a 'noop' action list. but this does not seem to help (in fact it screws up my animation and adds some fade).
The last odd thing is that this movement is related to aspect ratio. If I have a specific aspect ratio then everything is ok and the clickthrough doesn't happen. If I resize the game window then I can click sometimes and it will move the character. The inventory is in the top left character and the forceAspectRatio code is on.
Any thoughts as to what might be happening? Thanks.
Comments
Make a RectTransform child object in your UI prefab that spans the clickable area of your UI and assign it in your Menu's properties as the RectTransform boundary. Be sure to click Apply on the UI to update any changes to the prefab, and then test it out.
As @Alverik says, without screenshots to show your issue it's only possible to give general advice at this point - so if you need more help, please post with shots of your UI prefab and entry in the Menu Manager.
Ok, the click-through issue was definitely not having the correct Panel as the menu 'bounds'. I have updated my UI and everything works great! Thanks for your help!
Have you enabled speech-skipping? It may be related to that - try disabling that if so and see if the issue persists. Also check the state of your Menu's Ignore cursor clicks? option, and your UI's Interactable option.
You can use the Engine: Manage systems Action to disable the Interaction system if you need to disable Hotspot-clicking during regular gameplay. Another such Action could be used after the Dialogue: Stop speech Action to re-enable it.