Separating mouse button clicks from GUI and game input

In an imaginary game written in cSharp, I have a typical 3rd person controller and ground setup so I can walk about and punch with mouse or fire1 button.
I also have a GUI menu on during gameplay to do things like cast spells - for example fireball. Now, casting fireball from the GUI and starting the punch event are separate actions, but how do I get it so when I click ‘fireball’ on the GUI it does not also start the punch event ?

I think that Rect.Contains(), as is described in this post by Christian H Pedersen, is your only option. Unfortunately, as he mentions, it really is a convoluted fix to what should be an easily solved problem within Unity. Until the engine itself provides better and more user-friendly control over problems like this, I think this may be the only fix.

Hopefully that helped …

Klep

P.S - I’m a bit disconcerted as to what you mean by ‘imaginary game’ … are you implying that we really are a part of the Matrix!? Mind blown (and childhood dreams realised)! :wink: