Search Unity

Same script in more than one button issue

Discussion in 'UGUI & TextMesh Pro' started by Equ1nox, Mar 24, 2017.

  1. Equ1nox

    Equ1nox

    Joined:
    Sep 7, 2016
    Posts:
    3
    Hi community,

    I've got some trouble in my project and I need your help to understand my issue !

    I have 4 buttons which I have attached a script, the same script for each.
    The action "OnClic" call a method who instantiate a GameObject.

    BUT ! :(
    When I clic on a button the GameObject is Instantiate FOUR times ! :'((

    So obviously there are a relation with the buttons count so why ! WHY !!! That make me totally mad ...

    If someone has an early response he will save my day :)

    Thanks !
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    Post your code, or we can't possibly hope to help you.
     
  3. JC_SummitTech

    JC_SummitTech

    Joined:
    Nov 1, 2016
    Posts:
    78
    Please include your script otherwise it's near impossible to help.