just one more dumb dumb question

eboyeboy Member Posts: 239
edited November -1 in Working with GS (Mac)
ok, I know this is prob. a dumb question but hey I am a dummy.

So I would like to have a button that activates an actor to move up, hold in a rest position a bit and then move back down the same way.

Help...I tried it and it just doesn't work for me...

Comments

  • butterbeanbutterbean Member Posts: 4,315
    Here's one solution:

    Create an attribute: Move Character (boolean)

    When attribute: move character is true

    Timer: For 1 second: Move UP (speed 100)

    Timer: After 2 seconds:

    For 1 second

    Move Down (speed: 100)

    then on the button: When touch is pressed: Change attribute: Move character : true

    make sure to keep the speed variables the same if you want the actor in the same position as before, otherwise you can tweak the timers

    Also, make sure to reset your attribute: move character to false

    You can reset it when the character is moving down

    Hope this helps!
  • eboyeboy Member Posts: 239
    cool, one extra dumb question how to edit the condition of the attribute?

    When attribute: move character is true/

    Is that a CHANGE ATTRIBUTE behavior?
  • butterbeanbutterbean Member Posts: 4,315
    The button you're pressing is changing the attribute to "True" when pressed

    Then you also put a rule in that says: When touch is released, change attribute: game.move character to false

    So within the actor (character) itself, you're then creating a rule that says"

    Rule: When game.move character is true

    Timer: for 1 second
    Move: up Speed: 100

    You don't need to add anything else other than the above within your actor
  • eboyeboy Member Posts: 239
    NICE! Thanks!
  • eboyeboy Member Posts: 239
    uh just one more, for change attribute, in the expression editor, what is the value for TRUE, I don't see anything. Thanks for the help...very cool.
  • butterbeanbutterbean Member Posts: 4,315
    When I do a change attribute, I always do this:

    When game.move character is: true ( I just type in true, but you can also put in a 1 to indicate true, and a 0 to indicate false if I'm not mistaken, I've just always done it the other way)
  • eboyeboy Member Posts: 239
    ;)
  • eboyeboy Member Posts: 239
    Hmm, I must be extra dumb, it seems the button is moving and not the actor...is there a project example of this? I must be getting my rules mixed up....Thanks.
Sign In or Register to comment.