best way to Pause an Actor?

KangavarkKangavark Member Posts: 62
edited July 2012 in Working with GS (Mac)
sorry if there is an obvious solution that I'm just not seeing, but here's the situation:

There is a rotating and moving actor on the scene that I would like to pause (freeze) upon touch (and unfreeze when touched again). How can I accomplish this? I thought I had to make a pause Attribute (real) that would change to "1" upon touch--based on a Rule. Unfortunately, this isn't working.

I have a follow up question, but I'll wait to see if this one can be answered first.

thanks in advance.

Comments

  • Goodnight GamesGoodnight Games NYCMember, PRO Posts: 184
    Find his rotation attribute in self then keep track of it in an attribute. Once that's done make a rule that says on press change his rotation to that attribute and if you have something that's making it rotate wrap a rule around that with a boolean so you can turn it on and off on press.
  • KangavarkKangavark Member Posts: 62
    update: I managed to get the actor to pause (freeze) by tweaking T-Shirt Booth's tutorial on constraining an actor without using Gamesalad's Pause action. But now I'm trying to Unpause the actor by touching it, but I'm not sure how I go about it.
  • ironDanironDan Member Posts: 148
    Make a global Index attribute called pause. Then in the actor that you touch to pause
    make a rule that says

    When touch is pressed change attribute game.pause to (game.pause+1)%2

    All this does is say when the actor is touched and game.pause is 0 it changes to 1 and when game.pause is 1 it changes to 0

    Then in your actor just use game.pause = 0 to fire the rules you made to stop your actor and game.pause = 1 to set them back in motion

    Good luck
    Dan
  • KangavarkKangavark Member Posts: 62
    thanks Dan. I don't know what I'm doing wrong...I'm still not able to unpause my actors...
  • KangavarkKangavark Member Posts: 62
    Make a global Index attribute called pause. Then in the actor that you touch to pause
    make a rule that says

    When touch is pressed change attribute game.pause to (game.pause+1)%2

    All this does is say when the actor is touched and game.pause is 0 it changes to 1 and when game.pause is 1 it changes to 0

    Then in your actor just use game.pause = 0 to fire the rules you made to stop your actor and game.pause = 1 to set them back in motion

    Good luck
    Dan
    I got this to work, but this ends up pausing and unpausing ALL of my moving actors. I need something that will pause ONLY the actor that's touched.

    anybody?
  • MotherHooseMotherHoose Member Posts: 2,456
    @Kangavark … for actions/events that only affect the individual actor
    …add the attributes to control them to that actor

    follow @ironDan … great help! … but make it self.pause not game.pause

    image MH
Sign In or Register to comment.