Skip to main content
3 of 7
added 60 characters in body
pguetschow
  • 191
  • 2
  • 12

Prevent Unity click go trough Canvas

I'm currently facing this problem: If I click on a Button on my Canvas, the currently selected Unit moves towards the location under the Button.

Is is there any option to solve this? I'm using the A* Project for this.

Sadly, I can not provide a lot of things I've done so far as I absolutely have no clue how to solve this problem.

If I disable the Button Option "Raycast Target" ist still moves to this position but holds a bit earlier.

Also, adding this as check didn't work:

if (!EventSystem.current.IsPointerOverGameObject() )

I also checked if the Raycast hit's the layer of the GUI

pguetschow
  • 191
  • 2
  • 12