Stopping an actor falling with a stop button

EsayemEsayem Member Posts: 8
edited August 2012 in Working with GS (PC)
Hi there

I'm looking for a way to stop an actor through the use of a button. I basically have one actor falling in a vertical line, but I want to stop it's movement with a 'stop' button. Any ideas as to how I could approach this? I'm very new to game salad and have mostly been experimenting with some basic functions.

Thanks in advance!

Comments

  • simo103simo103 Member, PRO Posts: 1,331
    edited August 2012
    @Esayem .. create a Game.attribute (boolean) named something like Game.StopFall.

    In the button put a rule when pressed change Game.StopFall to true. In the falling actor put when Game.StopFall is true change attribute self.motion.linear.velocityY to 0. You will want to put a rule around your falling rules so it says if Game.StopFall is false then ... and that would surround your gravity/fall rules.
  • EsayemEsayem Member Posts: 8
    Brilliant thanks!
Sign In or Register to comment.