I currently have a Player Control Type set to "Mouse" in conjunction with a NavMeshAgent.
I also have a HUD set to auto display with a HUD Click component that runs some custom logic on schematic. But I'm having trouble blocking the mouse click when the player clicks over the HUD. Right now whenever the player clicks over the HUD the Player avatar/combatant will travel to the position on the screen where the HUD is placed (bottom left corner of the screen and but I just want the cursor click to be blocked when over a UI element. I've tried enabling consume click on the Hud click component and toggling the "Pressed Ignore cursor over" setting on the Player control settings. Neither seems to be working.
  • edited March 2023
    Add a UI Receive Cursor Events component to the root of your HUD prefab (or the parts that should block).
    It needs some form of graphic (e.g. an image, even if it's empty) on the same game object to actually receive clicks and block them, though.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.