Hi,
I have a button, that works fine when I click it, but the player also moves. I want the player to move, only when I don't click on a button. The button is a prefab of Unity UI.
I already tried with CanvasGroup's blocking object property, but it didn't work.
Comments
That will block clicks (you can test this by assigning the Demo_MenuManager asset as your Menu Manager, viewing the InGame Menu's properties, changing the Source to Unity Ui Prefab, and changing the Click type to Run ActionList).
Assuming the InGame UI works for you as intended, try to find the difference between that and yours that's causing the problem.
The following function can be used to reset the mouse click once it's been recieved to prevent it from having an effect on anything else AC-related:
AC.KickStarter.playerInput.ResetClick ();
Hello, I've a similar problem. I could use the script gbo wrote, but I wonder why if I click a button on a UnityUI prefab that is linked to the AC Menu Manager, it still triggers the movement of my Player.
All the rest is like gbo says... UI prefab with small buttons at the 4 corners of my screen, so I cannot set a single panel (unless it covers the whole screen, but then I cannot navigate anymore on my scene).
So basically AC is not blocking clicks on my NavMesh even if a button is catching the click (it's a MAP button that crossfade between Menus: game goes into pause, I see the new menu, when I close the menu my player continue walking to where my MAP button is).
Any idea why?
The click-blocking works by using the RectTransform boundary field for reference - so if you haven't supplied one, then clicks will not block anything.
That is, unless you check Unity UI blocks interaction and movement? in the Settings Manager.