How to make a movable actor immovable when hit by enemies

blackmoroiblackmoroi Member Posts: 28
edited September 2014 in Working with GS (PC)
Pls help me..I am trying a top down maze game in which player has to move some blocks to advance the level.but the blocks should not move if hit by enemies.plss help me what to do..I tried many methods like varying the weight and drag but still no use....Pls give a suggestion..


  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,914
    edited September 2014

    Contrain the positions of the blocks unless they come in contact with the player.

    Make 2 self attributes "real type"


    Constrain attribute. Self-X to self.position.X

    Constrain attribute. Self-Y to self.position.Y


    When actor receives event "overlaps and collides with player"

    No code in main part of rule


    Constrain attribute self.position.X to Self-X

    Constrain attribute self.position.Y to Self-You

    Make sure the code is ordered top to bottom as written so the position gets written to the self attributes before the otherwise of the rule kicks in.

  • blackmoroiblackmoroi Member Posts: 28

    thanks a lot..I understood the ideas.Let me try it on my game.again thanku very much... <3 :)

Sign In or Register to comment.