Creating a simple button

Hello,
Today I've started working with GameSalad for the very first time. In my game, I'm trying to make a simple button. This button is displayed by an actor.
On clicking that button, somewhere else (that is, on another actor) a certain value (a game.attribute) should be displayed . I've followed all steps as described in https://help.gamesalad.com/hc/en-us/articles/203081087-2-4-Setting-up-Score-Systems-in-GameSalad.
I've set up a rule to change the game.attribute whenever the button is pressed. In order to do so, I've set the condition for the rule to 'when actor receives event: touch is pressed' As I've read in https://help.gamesalad.com/hc/en-us/articles/202035973-2-5-Menu-Systems-in-GameSalad, that is how a button should be triggered to make something happen. Unfortunately, nothing happens. Any ideas how I can make this simple button just work and display the value properly?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @NielsJoormann said:
    On clicking that button, somewhere else (that is, on another actor) a certain value (a game.attribute) should be displayed.

    You can't actually "click that button somewhere else." You either click the button/actor or you click elsewhere. If you want to have a value displayed on one actor when you click another actor, do this:

    Clickable actor:
    When Touch is Pressed, change attribute game.clicked (boolean) to true
    Display actor:
    When game.clicked is true Display Text [text to show]

    You then need to decide when to change game.clicked to false (e.g. after a certain amount of time, using a Timer behavior). I would also add a When game.clicked is false condition to the Clickable actor so that you can't just continually click it.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • AdrenalineAdrenaline Member Posts: 523

    @tatiang said:
    You can't actually "click that button somewhere else."

    I read it that way the first time too, but I THINK he meant that the game attribute is somewhere else. Ex: click that button, and then somewhere else a game attribute should be displayed

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @Adrenaline, you're right. My mistake.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • NielsJoormannNielsJoormann Member Posts: 2

    @Adrenaline was right indeed! I want to click the button and let the value display somewhere else. How can I do that?

Sign In or Register to comment.