Moveable when collide, immovable when not colliding with anything?

rickynikorickyniko Member Posts: 85
edited November -1 in Working with GS (Mac)
Hi, is there a way to make an actor(1) moveable when it is colliding with actor(2), and then switch to immovable once its not touching actor(2)?

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    To do that, you would place a Rule in Actor 1, like this:

    Rule
    When all conditions are valid:
    Overlaps or collides with Actor of type Actor 2
    -----[place movement code here]
    otherwise
    -----[place stop movement code here]

    That's the basic premise...
  • rickynikorickyniko Member Posts: 85
    thanks for the response, but, in this game, you move around actor 2, and push actor 1's around to get through the maze, so you dont actually control actor 1 with any buttons, its moved around by pushing it with actor 2, know what i mean?
  • firemaplegamesfiremaplegames Member Posts: 3,211
    You can try something like this, in Actor 1:

    Rule
    When all conditions are valid:
    Overlaps or collides with Actor of type Actor 2
    -----[nothing goes here]
    otherwise
    -----Change Attribute: self.Motion.Linear.X to: 0
    -----Change Attribute: self.Motion.Linear.Y to: 0
  • rickynikorickyniko Member Posts: 85
    works great. thanks alot, really gonna speed up this game making process! :)
Sign In or Register to comment.