Search Unity

GUI Click not attack

Discussion in 'Scripting' started by rastinrastini, Apr 7, 2011.

  1. rastinrastini

    rastinrastini

    Joined:
    Jul 8, 2010
    Posts:
    158
    hi
    i have an gui (inventory) when i click on it my attack animation(i called attack animation with every mouse 0 click) i play.
    i want when my mouse is in inventory or casting panel and mouse 0 clicked then dont play my attack animation.
    any one can help?
    thankful.
     
  2. Avo

    Avo

    Joined:
    Dec 4, 2010
    Posts:
    237
    Have a Boolean variable "inventoryopen" set to false right off the bat. When you open your inventory set it to true, and when you close your inventory set it to false. Then when you play through your attack script you check to make sure its set to false.
     
  3. rastinrastini

    rastinrastini

    Joined:
    Jul 8, 2010
    Posts:
    158
    1-can understand when mouse enter window?(inventory window)
    2-Avo thanks for your answer.i want when inventory is open and player click in the area that is out of inventory window then animation.play start.
    thankful.
     
    Last edited: Apr 7, 2011
  4. CodeCody

    CodeCody

    Joined:
    Apr 27, 2010
    Posts:
    440
  5. TheRaider

    TheRaider

    Joined:
    Dec 5, 2010
    Posts:
    2,250
    Thank you king, this really really helps me. I never knew how to solve this issue.
     
  6. rastinrastini

    rastinrastini

    Joined:
    Jul 8, 2010
    Posts:
    158
    very thankful for your help
    Thankful.